tamagui 1.0.21 → 1.0.22
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/lib/linear-gradient.js +29 -0
- package/dist/cjs/lib/linear-gradient.js.map +7 -0
- package/dist/cjs/polyfills.js +11 -0
- package/dist/cjs/polyfills.js.map +7 -0
- package/dist/cjs/views/LinearGradient.js +75 -0
- package/dist/cjs/views/LinearGradient.js.map +7 -0
- package/dist/esm/lib/linear-gradient.js +5 -0
- package/dist/esm/lib/linear-gradient.js.map +7 -0
- package/dist/esm/polyfills.js +10 -0
- package/dist/esm/polyfills.js.map +7 -0
- package/dist/esm/views/LinearGradient.js +47 -0
- package/dist/esm/views/LinearGradient.js.map +7 -0
- package/dist/jsx/lib/linear-gradient.js +5 -0
- package/dist/jsx/lib/linear-gradient.js.map +7 -0
- package/dist/jsx/polyfills.js +10 -0
- package/dist/jsx/polyfills.js.map +7 -0
- package/dist/jsx/views/LinearGradient.js +35 -0
- package/dist/jsx/views/LinearGradient.js.map +7 -0
- package/package.json +44 -44
|
@@ -0,0 +1,29 @@
|
|
|
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 __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var linear_gradient_exports = {};
|
|
20
|
+
__export(linear_gradient_exports, {
|
|
21
|
+
LinearGradient: () => import_expo_linear_gradient.LinearGradient
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(linear_gradient_exports);
|
|
24
|
+
var import_expo_linear_gradient = require("expo-linear-gradient");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
LinearGradient
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=linear-gradient.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/linear-gradient.ts"],
|
|
4
|
+
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
if (typeof requestAnimationFrame === "undefined") {
|
|
3
|
+
globalThis["requestAnimationFrame"] = setImmediate;
|
|
4
|
+
}
|
|
5
|
+
global.cancelAnimationFrame = (x) => {
|
|
6
|
+
try {
|
|
7
|
+
cancelAnimationFrame(x);
|
|
8
|
+
} catch {
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=polyfills.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/polyfills.ts"],
|
|
4
|
+
"sourcesContent": ["// for SSR\nif (typeof requestAnimationFrame === 'undefined') {\n globalThis['requestAnimationFrame'] = setImmediate\n}\n\n// for vite / Animated.spring()\nglobal.cancelAnimationFrame = (x) => {\n try {\n cancelAnimationFrame(x)\n } catch {\n // illegal invocation :/\n }\n}\n"],
|
|
5
|
+
"mappings": ";AACA,IAAI,OAAO,0BAA0B,aAAa;AAChD,aAAW,2BAA2B;AACxC;AAGA,OAAO,uBAAuB,CAAC,MAAM;AACnC,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAE;AAAA,EAEF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var LinearGradient_exports = {};
|
|
26
|
+
__export(LinearGradient_exports, {
|
|
27
|
+
LinearGradient: () => LinearGradient
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(LinearGradient_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var import_core = require("@tamagui/core");
|
|
32
|
+
var import_stacks = require("@tamagui/stacks");
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react_native = require("react-native");
|
|
35
|
+
var import_linear_gradient = require("../lib/linear-gradient");
|
|
36
|
+
React["createElement"];
|
|
37
|
+
const LinearGradient = import_stacks.YStack.extractable(
|
|
38
|
+
(0, import_core.themeable)(
|
|
39
|
+
React.forwardRef((props, ref) => {
|
|
40
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
41
|
+
const colors = useThemeColors(colorsProp || []);
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinearGradientFrame, {
|
|
43
|
+
ref,
|
|
44
|
+
...stackProps,
|
|
45
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_linear_gradient.LinearGradient, {
|
|
46
|
+
start,
|
|
47
|
+
end,
|
|
48
|
+
colors,
|
|
49
|
+
locations,
|
|
50
|
+
style: [import_react_native.StyleSheet.absoluteFill],
|
|
51
|
+
children
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
const LinearGradientFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
58
|
+
name: "LinearGradient",
|
|
59
|
+
overflow: "hidden",
|
|
60
|
+
position: "relative"
|
|
61
|
+
});
|
|
62
|
+
const useThemeColors = (colors) => {
|
|
63
|
+
const theme = (0, import_core.useTheme)();
|
|
64
|
+
return colors.map((color) => {
|
|
65
|
+
if (color[0] === "$") {
|
|
66
|
+
return (0, import_core.getVariable)(theme[color] || color);
|
|
67
|
+
}
|
|
68
|
+
return color;
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
LinearGradient
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=LinearGradient.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/LinearGradient.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ColorTokens, ThemeTokens, getVariable, styled, themeable, useTheme } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from '../lib/linear-gradient'\n\n// // bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type LinearGradientProps = Omit<ExpoLinearGradientProps, 'colors'> &\n Omit<YStackProps, 'children' | keyof ExpoLinearGradientProps> & {\n colors?: (ColorTokens | ThemeTokens | (string & {}))[]\n }\n\nexport const LinearGradient: React.ForwardRefExoticComponent<\n LinearGradientProps & React.RefAttributes<HTMLElement | View>\n> = YStack.extractable(\n themeable(\n React.forwardRef((props: LinearGradientProps, ref) => {\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n // @ts-ignore\n <LinearGradientFrame ref={ref} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={[StyleSheet.absoluteFill]}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst LinearGradientFrame = styled(YStack, {\n name: 'LinearGradient',\n overflow: 'hidden',\n position: 'relative',\n})\n\n// resolve tamagui theme values\nconst useThemeColors = (colors: string[]) => {\n const theme = useTheme()\n return colors.map((color) => {\n if (color[0] === '$') {\n return getVariable(theme[color] || color)\n }\n return color\n })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BU;AA5BV,kBAAmF;AACnF,oBAAoC;AACpC,YAAuB;AACvB,0BAAiC;AAEjC,6BAGO;AAGP,MAAM;AAOC,MAAM,iBAET,qBAAO;AAAA,MACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,aAAa,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aAEE,4CAAC;AAAA,QAAoB;AAAA,QAAW,GAAG;AAAA,QACjC,sDAAC,uBAAAA,gBAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO,CAAC,+BAAW,YAAY;AAAA,UAE9B;AAAA,SACH;AAAA,OACF;AAAA,IAEJ,CAAC;AAAA,EACH;AACF;AAEA,MAAM,0BAAsB,oBAAO,sBAAQ;AAAA,EACzC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,CAAC;AAGD,MAAM,iBAAiB,CAAC,WAAqB;AAC3C,QAAM,YAAQ,sBAAS;AACvB,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,QAAI,MAAM,OAAO,KAAK;AACpB,iBAAO,yBAAY,MAAM,UAAU,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": ["ExpoLinearGradient"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/linear-gradient.ts"],
|
|
4
|
+
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/polyfills.ts"],
|
|
4
|
+
"sourcesContent": ["// for SSR\nif (typeof requestAnimationFrame === 'undefined') {\n globalThis['requestAnimationFrame'] = setImmediate\n}\n\n// for vite / Animated.spring()\nglobal.cancelAnimationFrame = (x) => {\n try {\n cancelAnimationFrame(x)\n } catch {\n // illegal invocation :/\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,IAAI,OAAO,0BAA0B,aAAa;AAChD,aAAW,2BAA2B;AACxC;AAGA,OAAO,uBAAuB,CAAC,MAAM;AACnC,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAE;AAAA,EAEF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getVariable, styled, themeable, useTheme } from "@tamagui/core";
|
|
3
|
+
import { YStack } from "@tamagui/stacks";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { StyleSheet } from "react-native";
|
|
6
|
+
import {
|
|
7
|
+
LinearGradient as ExpoLinearGradient
|
|
8
|
+
} from "../lib/linear-gradient";
|
|
9
|
+
React["createElement"];
|
|
10
|
+
const LinearGradient = YStack.extractable(
|
|
11
|
+
themeable(
|
|
12
|
+
React.forwardRef((props, ref) => {
|
|
13
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
14
|
+
const colors = useThemeColors(colorsProp || []);
|
|
15
|
+
return /* @__PURE__ */ jsx(LinearGradientFrame, {
|
|
16
|
+
ref,
|
|
17
|
+
...stackProps,
|
|
18
|
+
children: /* @__PURE__ */ jsx(ExpoLinearGradient, {
|
|
19
|
+
start,
|
|
20
|
+
end,
|
|
21
|
+
colors,
|
|
22
|
+
locations,
|
|
23
|
+
style: [StyleSheet.absoluteFill],
|
|
24
|
+
children
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
})
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
const LinearGradientFrame = styled(YStack, {
|
|
31
|
+
name: "LinearGradient",
|
|
32
|
+
overflow: "hidden",
|
|
33
|
+
position: "relative"
|
|
34
|
+
});
|
|
35
|
+
const useThemeColors = (colors) => {
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
return colors.map((color) => {
|
|
38
|
+
if (color[0] === "$") {
|
|
39
|
+
return getVariable(theme[color] || color);
|
|
40
|
+
}
|
|
41
|
+
return color;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
LinearGradient
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=LinearGradient.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/LinearGradient.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ColorTokens, ThemeTokens, getVariable, styled, themeable, useTheme } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from '../lib/linear-gradient'\n\n// // bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type LinearGradientProps = Omit<ExpoLinearGradientProps, 'colors'> &\n Omit<YStackProps, 'children' | keyof ExpoLinearGradientProps> & {\n colors?: (ColorTokens | ThemeTokens | (string & {}))[]\n }\n\nexport const LinearGradient: React.ForwardRefExoticComponent<\n LinearGradientProps & React.RefAttributes<HTMLElement | View>\n> = YStack.extractable(\n themeable(\n React.forwardRef((props: LinearGradientProps, ref) => {\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n // @ts-ignore\n <LinearGradientFrame ref={ref} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={[StyleSheet.absoluteFill]}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst LinearGradientFrame = styled(YStack, {\n name: 'LinearGradient',\n overflow: 'hidden',\n position: 'relative',\n})\n\n// resolve tamagui theme values\nconst useThemeColors = (colors: string[]) => {\n const theme = useTheme()\n return colors.map((color) => {\n if (color[0] === '$') {\n return getVariable(theme[color] || color)\n }\n return color\n })\n}\n"],
|
|
5
|
+
"mappings": "AA4BU;AA5BV,SAAmC,aAAa,QAAQ,WAAW,gBAAgB;AACnF,SAAS,cAA2B;AACpC,YAAY,WAAW;AACvB,SAAS,kBAAwB;AAEjC;AAAA,EACE,kBAAkB;AAAA,OAEb;AAGP,MAAM;AAOC,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,aAAa,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aAEE,oBAAC;AAAA,QAAoB;AAAA,QAAW,GAAG;AAAA,QACjC,8BAAC;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO,CAAC,WAAW,YAAY;AAAA,UAE9B;AAAA,SACH;AAAA,OACF;AAAA,IAEJ,CAAC;AAAA,EACH;AACF;AAEA,MAAM,sBAAsB,OAAO,QAAQ;AAAA,EACzC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,CAAC;AAGD,MAAM,iBAAiB,CAAC,WAAqB;AAC3C,QAAM,QAAQ,SAAS;AACvB,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,QAAI,MAAM,OAAO,KAAK;AACpB,aAAO,YAAY,MAAM,UAAU,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/linear-gradient.ts"],
|
|
4
|
+
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/polyfills.ts"],
|
|
4
|
+
"sourcesContent": ["// for SSR\nif (typeof requestAnimationFrame === 'undefined') {\n globalThis['requestAnimationFrame'] = setImmediate\n}\n\n// for vite / Animated.spring()\nglobal.cancelAnimationFrame = (x) => {\n try {\n cancelAnimationFrame(x)\n } catch {\n // illegal invocation :/\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,IAAI,OAAO,0BAA0B,aAAa;AAChD,aAAW,2BAA2B;AACxC;AAGA,OAAO,uBAAuB,CAAC,MAAM;AACnC,MAAI;AACF,yBAAqB,CAAC;AAAA,EACxB,QAAE;AAAA,EAEF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getVariable, styled, themeable, useTheme } from "@tamagui/core";
|
|
2
|
+
import { YStack } from "@tamagui/stacks";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
import {
|
|
6
|
+
LinearGradient as ExpoLinearGradient
|
|
7
|
+
} from "../lib/linear-gradient";
|
|
8
|
+
React["createElement"];
|
|
9
|
+
const LinearGradient = YStack.extractable(
|
|
10
|
+
themeable(
|
|
11
|
+
React.forwardRef((props, ref) => {
|
|
12
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
13
|
+
const colors = useThemeColors(colorsProp || []);
|
|
14
|
+
return <LinearGradientFrame ref={ref} {...stackProps}><ExpoLinearGradient start={start} end={end} colors={colors} locations={locations} style={[StyleSheet.absoluteFill]}>{children}</ExpoLinearGradient></LinearGradientFrame>;
|
|
15
|
+
})
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
const LinearGradientFrame = styled(YStack, {
|
|
19
|
+
name: "LinearGradient",
|
|
20
|
+
overflow: "hidden",
|
|
21
|
+
position: "relative"
|
|
22
|
+
});
|
|
23
|
+
const useThemeColors = (colors) => {
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
return colors.map((color) => {
|
|
26
|
+
if (color[0] === "$") {
|
|
27
|
+
return getVariable(theme[color] || color);
|
|
28
|
+
}
|
|
29
|
+
return color;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
LinearGradient
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=LinearGradient.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/views/LinearGradient.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ColorTokens, ThemeTokens, getVariable, styled, themeable, useTheme } from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from '../lib/linear-gradient'\n\n// // bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type LinearGradientProps = Omit<ExpoLinearGradientProps, 'colors'> &\n Omit<YStackProps, 'children' | keyof ExpoLinearGradientProps> & {\n colors?: (ColorTokens | ThemeTokens | (string & {}))[]\n }\n\nexport const LinearGradient: React.ForwardRefExoticComponent<\n LinearGradientProps & React.RefAttributes<HTMLElement | View>\n> = YStack.extractable(\n themeable(\n React.forwardRef((props: LinearGradientProps, ref) => {\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n // @ts-ignore\n <LinearGradientFrame ref={ref} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={[StyleSheet.absoluteFill]}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst LinearGradientFrame = styled(YStack, {\n name: 'LinearGradient',\n overflow: 'hidden',\n position: 'relative',\n})\n\n// resolve tamagui theme values\nconst useThemeColors = (colors: string[]) => {\n const theme = useTheme()\n return colors.map((color) => {\n if (color[0] === '$') {\n return getVariable(theme[color] || color)\n }\n return color\n })\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmC,aAAa,QAAQ,WAAW,gBAAgB;AACnF,SAAS,cAA2B;AACpC,YAAY,WAAW;AACvB,SAAS,kBAAwB;AAEjC;AAAA,EACE,kBAAkB;AAAA,OAEb;AAGP,MAAM;AAOC,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,aAAa,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aAEE,CAAC,oBAAoB,KAAK,SAAS,YACjC,CAAC,mBACC,OAAO,OACP,KAAK,KACL,QAAQ,QACR,WAAW,WACX,OAAO,CAAC,WAAW,YAAY,IAE9B,SACH,EARC,mBASH,EAVC;AAAA,IAYL,CAAC;AAAA,EACH;AACF;AAEA,MAAM,sBAAsB,OAAO,QAAQ;AAAA,EACzC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,CAAC;AAGD,MAAM,iBAAiB,CAAC,WAAqB;AAC3C,QAAM,QAAQ,SAAS;AACvB,SAAO,OAAO,IAAI,CAAC,UAAU;AAC3B,QAAI,MAAM,OAAO,KAAK;AACpB,aAAO,YAAY,MAAM,UAAU,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css",
|
|
6
6
|
"*setup.js"
|
|
@@ -33,48 +33,48 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tamagui/adapt": "^1.0.
|
|
37
|
-
"@tamagui/alert-dialog": "^1.0.
|
|
38
|
-
"@tamagui/animate-presence": "^1.0.
|
|
39
|
-
"@tamagui/avatar": "^1.0.
|
|
40
|
-
"@tamagui/button": "^1.0.
|
|
41
|
-
"@tamagui/card": "^1.0.
|
|
42
|
-
"@tamagui/compose-refs": "^1.0.
|
|
43
|
-
"@tamagui/core": "^1.0.
|
|
44
|
-
"@tamagui/create-context": "^1.0.
|
|
45
|
-
"@tamagui/dialog": "^1.0.
|
|
46
|
-
"@tamagui/fake-react-native": "^1.0.
|
|
47
|
-
"@tamagui/font-size": "^1.0.
|
|
48
|
-
"@tamagui/get-button-sized": "^1.0.
|
|
49
|
-
"@tamagui/get-font-sized": "^1.0.
|
|
50
|
-
"@tamagui/get-size": "^1.0.
|
|
51
|
-
"@tamagui/helpers": "^1.0.
|
|
52
|
-
"@tamagui/helpers-tamagui": "^1.0.
|
|
53
|
-
"@tamagui/image": "^1.0.
|
|
54
|
-
"@tamagui/label": "^1.0.
|
|
55
|
-
"@tamagui/linear-gradient": "^1.0.
|
|
56
|
-
"@tamagui/list-item": "^1.0.
|
|
57
|
-
"@tamagui/popover": "^1.0.
|
|
58
|
-
"@tamagui/popper": "^1.0.
|
|
59
|
-
"@tamagui/portal": "^1.0.
|
|
60
|
-
"@tamagui/progress": "^1.0.
|
|
61
|
-
"@tamagui/react-native-media-driver": "^1.0.
|
|
62
|
-
"@tamagui/scroll-view": "^1.0.
|
|
63
|
-
"@tamagui/select": "^1.0.
|
|
64
|
-
"@tamagui/separator": "^1.0.
|
|
65
|
-
"@tamagui/shapes": "^1.0.
|
|
66
|
-
"@tamagui/sheet": "^1.0.
|
|
67
|
-
"@tamagui/slider": "^1.0.
|
|
68
|
-
"@tamagui/stacks": "^1.0.
|
|
69
|
-
"@tamagui/switch": "^1.0.
|
|
70
|
-
"@tamagui/text": "^1.0.
|
|
71
|
-
"@tamagui/tooltip": "^1.0.
|
|
72
|
-
"@tamagui/use-controllable-state": "^1.0.
|
|
73
|
-
"@tamagui/use-debounce": "^1.0.
|
|
74
|
-
"@tamagui/use-event": "^1.0.
|
|
75
|
-
"@tamagui/use-force-update": "^1.0.
|
|
76
|
-
"@tamagui/use-window-dimensions": "^1.0.
|
|
77
|
-
"@tamagui/visually-hidden": "^1.0.
|
|
36
|
+
"@tamagui/adapt": "^1.0.22",
|
|
37
|
+
"@tamagui/alert-dialog": "^1.0.22",
|
|
38
|
+
"@tamagui/animate-presence": "^1.0.22",
|
|
39
|
+
"@tamagui/avatar": "^1.0.22",
|
|
40
|
+
"@tamagui/button": "^1.0.22",
|
|
41
|
+
"@tamagui/card": "^1.0.22",
|
|
42
|
+
"@tamagui/compose-refs": "^1.0.22",
|
|
43
|
+
"@tamagui/core": "^1.0.22",
|
|
44
|
+
"@tamagui/create-context": "^1.0.22",
|
|
45
|
+
"@tamagui/dialog": "^1.0.22",
|
|
46
|
+
"@tamagui/fake-react-native": "^1.0.22",
|
|
47
|
+
"@tamagui/font-size": "^1.0.22",
|
|
48
|
+
"@tamagui/get-button-sized": "^1.0.22",
|
|
49
|
+
"@tamagui/get-font-sized": "^1.0.22",
|
|
50
|
+
"@tamagui/get-size": "^1.0.22",
|
|
51
|
+
"@tamagui/helpers": "^1.0.22",
|
|
52
|
+
"@tamagui/helpers-tamagui": "^1.0.22",
|
|
53
|
+
"@tamagui/image": "^1.0.22",
|
|
54
|
+
"@tamagui/label": "^1.0.22",
|
|
55
|
+
"@tamagui/linear-gradient": "^1.0.22",
|
|
56
|
+
"@tamagui/list-item": "^1.0.22",
|
|
57
|
+
"@tamagui/popover": "^1.0.22",
|
|
58
|
+
"@tamagui/popper": "^1.0.22",
|
|
59
|
+
"@tamagui/portal": "^1.0.22",
|
|
60
|
+
"@tamagui/progress": "^1.0.22",
|
|
61
|
+
"@tamagui/react-native-media-driver": "^1.0.22",
|
|
62
|
+
"@tamagui/scroll-view": "^1.0.22",
|
|
63
|
+
"@tamagui/select": "^1.0.22",
|
|
64
|
+
"@tamagui/separator": "^1.0.22",
|
|
65
|
+
"@tamagui/shapes": "^1.0.22",
|
|
66
|
+
"@tamagui/sheet": "^1.0.22",
|
|
67
|
+
"@tamagui/slider": "^1.0.22",
|
|
68
|
+
"@tamagui/stacks": "^1.0.22",
|
|
69
|
+
"@tamagui/switch": "^1.0.22",
|
|
70
|
+
"@tamagui/text": "^1.0.22",
|
|
71
|
+
"@tamagui/tooltip": "^1.0.22",
|
|
72
|
+
"@tamagui/use-controllable-state": "^1.0.22",
|
|
73
|
+
"@tamagui/use-debounce": "^1.0.22",
|
|
74
|
+
"@tamagui/use-event": "^1.0.22",
|
|
75
|
+
"@tamagui/use-force-update": "^1.0.22",
|
|
76
|
+
"@tamagui/use-window-dimensions": "^1.0.22",
|
|
77
|
+
"@tamagui/visually-hidden": "^1.0.22"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"react": "*",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"react-native-web": "*"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@tamagui/build": "^1.0.
|
|
85
|
+
"@tamagui/build": "^1.0.22",
|
|
86
86
|
"@types/node": "^16.11.9",
|
|
87
87
|
"@types/react": "^18.0.15",
|
|
88
88
|
"react": "^18.2.0",
|