@tamagui/linear-gradient 1.14.1 → 1.14.3
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/LinearGradient.js +18 -1
- package/dist/cjs/LinearGradient.js.map +2 -2
- package/dist/cjs/LinearGradient.native.js +32 -1
- package/dist/cjs/LinearGradient.native.js.map +2 -2
- package/dist/cjs/LinearGradient.shared.js +83 -1
- package/dist/cjs/LinearGradient.shared.js.map +2 -2
- package/dist/cjs/index.js +18 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/linear-gradient.js +28 -1
- package/dist/cjs/linear-gradient.js.map +2 -2
- package/dist/esm/LinearGradient.js +1 -1
- package/dist/esm/LinearGradient.js.map +1 -1
- package/dist/esm/LinearGradient.mjs +1 -1
- package/dist/esm/LinearGradient.mjs.map +1 -1
- package/dist/esm/LinearGradient.native.js +8 -1
- package/dist/esm/LinearGradient.native.js.map +2 -2
- package/dist/esm/LinearGradient.native.mjs +8 -1
- package/dist/esm/LinearGradient.native.mjs.map +2 -2
- package/dist/esm/LinearGradient.shared.js +57 -1
- package/dist/esm/LinearGradient.shared.js.map +2 -2
- package/dist/esm/LinearGradient.shared.mjs +57 -1
- package/dist/esm/LinearGradient.shared.mjs.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/linear-gradient.js +4 -1
- package/dist/esm/linear-gradient.js.map +2 -2
- package/dist/esm/linear-gradient.mjs +4 -1
- package/dist/esm/linear-gradient.mjs.map +2 -2
- package/dist/jsx/LinearGradient.js +1 -1
- package/dist/jsx/LinearGradient.js.map +1 -1
- package/dist/jsx/LinearGradient.mjs +1 -1
- package/dist/jsx/LinearGradient.mjs.map +1 -1
- package/dist/jsx/LinearGradient.native.js +7 -1
- package/dist/jsx/LinearGradient.native.js.map +2 -2
- package/dist/jsx/LinearGradient.native.mjs +7 -1
- package/dist/jsx/LinearGradient.native.mjs.map +2 -2
- package/dist/jsx/LinearGradient.shared.js +52 -1
- package/dist/jsx/LinearGradient.shared.js.map +2 -2
- package/dist/jsx/LinearGradient.shared.mjs +52 -1
- package/dist/jsx/LinearGradient.shared.mjs.map +2 -2
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/linear-gradient.js +4 -1
- package/dist/jsx/linear-gradient.js.map +2 -2
- package/dist/jsx/linear-gradient.mjs +4 -1
- package/dist/jsx/linear-gradient.mjs.map +2 -2
- package/package.json +4 -4
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var LinearGradient_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(LinearGradient_exports);
|
|
18
|
+
__reExport(LinearGradient_exports, require("./LinearGradient.shared"), module.exports);
|
|
2
19
|
//# sourceMappingURL=LinearGradient.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.tsx"],
|
|
4
4
|
"sourcesContent": ["export * from './LinearGradient.shared'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAc,oCAAd;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
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 LinearGradient_native_exports = {};
|
|
20
|
+
__export(LinearGradient_native_exports, {
|
|
21
|
+
LinearGradient: () => LinearGradient
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LinearGradient_native_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
function LinearGradient(props) {
|
|
26
|
+
const Real = require("./LinearGradient.shared").LinearGradient;
|
|
27
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Real, { ...props });
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
LinearGradient
|
|
32
|
+
});
|
|
2
33
|
//# sourceMappingURL=LinearGradient.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.native.tsx"],
|
|
4
4
|
"sourcesContent": ["/**\n * Fake file require just so native users can avoid installing\n * expo stuff up front for native.\n */\n\nexport function LinearGradient(props) {\n const Real = require('./LinearGradient.shared').LinearGradient\n\n return <Real {...props} />\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQS;AAHF,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,4CAAC,QAAM,GAAG,OAAO;AAC1B;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,84 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var LinearGradient_shared_exports = {};
|
|
30
|
+
__export(LinearGradient_shared_exports, {
|
|
31
|
+
LinearGradient: () => LinearGradient
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(LinearGradient_shared_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_core = require("@tamagui/core");
|
|
36
|
+
var import_stacks = require("@tamagui/stacks");
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_linear_gradient = require("./linear-gradient");
|
|
39
|
+
const LinearGradient = import_stacks.YStack.extractable(
|
|
40
|
+
(0, import_core.themeable)(
|
|
41
|
+
React.forwardRef((propsIn, ref) => {
|
|
42
|
+
const props = (0, import_core.useMediaPropsActive)(propsIn);
|
|
43
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
44
|
+
const colors = useThemeColors(colorsProp || []);
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinearGradientFrame, { ref, ...stackProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
import_linear_gradient.LinearGradient,
|
|
47
|
+
{
|
|
48
|
+
start,
|
|
49
|
+
end,
|
|
50
|
+
colors,
|
|
51
|
+
locations,
|
|
52
|
+
style: absoluteFill,
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
const absoluteFill = {
|
|
60
|
+
position: "absolute",
|
|
61
|
+
top: 0,
|
|
62
|
+
left: 0,
|
|
63
|
+
right: 0,
|
|
64
|
+
bottom: 0
|
|
65
|
+
};
|
|
66
|
+
const LinearGradientFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
67
|
+
name: "LinearGradient",
|
|
68
|
+
overflow: "hidden",
|
|
69
|
+
position: "relative"
|
|
70
|
+
});
|
|
71
|
+
const useThemeColors = (colors) => {
|
|
72
|
+
const theme = (0, import_core.useTheme)();
|
|
73
|
+
return colors.map((color) => {
|
|
74
|
+
if (color[0] === "$") {
|
|
75
|
+
return (0, import_core.getVariable)(theme[color] || color);
|
|
76
|
+
}
|
|
77
|
+
return color;
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
LinearGradient
|
|
83
|
+
});
|
|
2
84
|
//# sourceMappingURL=LinearGradient.shared.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n ThemeTokens,\n getVariable,\n styled,\n themeable,\n useMediaPropsActive,\n useTheme,\n} from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport type { View, ViewStyle } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from './linear-gradient'\n\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((propsIn: LinearGradientProps, ref) => {\n const props = useMediaPropsActive(propsIn)\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n <LinearGradientFrame ref={ref as any} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={absoluteFill}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst absoluteFill: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n}\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": "
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCU;AAlCV,kBAQO;AACP,oBAAoC;AACpC,YAAuB;AAGvB,6BAGO;AAQA,MAAM,iBAET,qBAAO;AAAA,MACT;AAAA,IACE,MAAM,WAAW,CAAC,SAA8B,QAAQ;AACtD,YAAM,YAAQ,iCAAoB,OAAO;AACzC,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aACE,4CAAC,uBAAoB,KAAkB,GAAG,YACxC;AAAA,QAAC,uBAAAA;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO;AAAA,UAEN;AAAA;AAAA,MACH,GACF;AAAA,IAEJ,CAAC;AAAA,EACH;AACF;AAEA,MAAM,eAA0B;AAAA,EAC9B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;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,CAAC,MAAM,KAAK;AACpB,iBAAO,yBAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": ["ExpoLinearGradient"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./LinearGradient"), module.exports);
|
|
2
19
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './LinearGradient'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,6BAAd;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
});
|
|
2
29
|
//# sourceMappingURL=linear-gradient.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linear-gradient.ts"],
|
|
4
4
|
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAA+B;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient.shared";
|
|
1
|
+
export * from "./LinearGradient.shared";
|
|
2
2
|
//# sourceMappingURL=LinearGradient.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient.shared";
|
|
1
|
+
export * from "./LinearGradient.shared";
|
|
2
2
|
//# sourceMappingURL=LinearGradient.mjs.map
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
function LinearGradient(props) {
|
|
3
|
+
const Real = require("./LinearGradient.shared").LinearGradient;
|
|
4
|
+
return /* @__PURE__ */ jsx(Real, { ...props });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
LinearGradient
|
|
8
|
+
};
|
|
2
9
|
//# sourceMappingURL=LinearGradient.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.native.tsx"],
|
|
4
4
|
"sourcesContent": ["/**\n * Fake file require just so native users can avoid installing\n * expo stuff up front for native.\n */\n\nexport function LinearGradient(props) {\n const Real = require('./LinearGradient.shared').LinearGradient\n\n return <Real {...props} />\n}\n"],
|
|
5
|
-
"mappings": "AAQS,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAQS;AAHF,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,oBAAC,QAAM,GAAG,OAAO;AAC1B;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
function LinearGradient(props) {
|
|
3
|
+
const Real = require("./LinearGradient.shared").LinearGradient;
|
|
4
|
+
return /* @__PURE__ */ jsx(Real, { ...props });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
LinearGradient
|
|
8
|
+
};
|
|
2
9
|
//# sourceMappingURL=LinearGradient.native.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.native.tsx"],
|
|
4
4
|
"sourcesContent": ["/**\n * Fake file require just so native users can avoid installing\n * expo stuff up front for native.\n */\n\nexport function LinearGradient(props) {\n const Real = require('./LinearGradient.shared').LinearGradient\n\n return <Real {...props} />\n}\n"],
|
|
5
|
-
"mappings": "AAQS,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAQS;AAHF,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,oBAAC,QAAM,GAAG,OAAO;AAC1B;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
getVariable,
|
|
4
|
+
styled,
|
|
5
|
+
themeable,
|
|
6
|
+
useMediaPropsActive,
|
|
7
|
+
useTheme
|
|
8
|
+
} from "@tamagui/core";
|
|
9
|
+
import { YStack } from "@tamagui/stacks";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import {
|
|
12
|
+
LinearGradient as ExpoLinearGradient
|
|
13
|
+
} from "./linear-gradient";
|
|
14
|
+
const LinearGradient = YStack.extractable(
|
|
15
|
+
themeable(
|
|
16
|
+
React.forwardRef((propsIn, ref) => {
|
|
17
|
+
const props = useMediaPropsActive(propsIn);
|
|
18
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
19
|
+
const colors = useThemeColors(colorsProp || []);
|
|
20
|
+
return /* @__PURE__ */ jsx(LinearGradientFrame, { ref, ...stackProps, children: /* @__PURE__ */ jsx(
|
|
21
|
+
ExpoLinearGradient,
|
|
22
|
+
{
|
|
23
|
+
start,
|
|
24
|
+
end,
|
|
25
|
+
colors,
|
|
26
|
+
locations,
|
|
27
|
+
style: absoluteFill,
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
) });
|
|
31
|
+
})
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
const absoluteFill = {
|
|
35
|
+
position: "absolute",
|
|
36
|
+
top: 0,
|
|
37
|
+
left: 0,
|
|
38
|
+
right: 0,
|
|
39
|
+
bottom: 0
|
|
40
|
+
};
|
|
41
|
+
const LinearGradientFrame = styled(YStack, {
|
|
42
|
+
name: "LinearGradient",
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
position: "relative"
|
|
45
|
+
});
|
|
46
|
+
const useThemeColors = (colors) => {
|
|
47
|
+
const theme = useTheme();
|
|
48
|
+
return colors.map((color) => {
|
|
49
|
+
if (color[0] === "$") {
|
|
50
|
+
return getVariable(theme[color] || color);
|
|
51
|
+
}
|
|
52
|
+
return color;
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
LinearGradient
|
|
57
|
+
};
|
|
2
58
|
//# sourceMappingURL=LinearGradient.shared.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n ThemeTokens,\n getVariable,\n styled,\n themeable,\n useMediaPropsActive,\n useTheme,\n} from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport type { View, ViewStyle } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from './linear-gradient'\n\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((propsIn: LinearGradientProps, ref) => {\n const props = useMediaPropsActive(propsIn)\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n <LinearGradientFrame ref={ref as any} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={absoluteFill}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst absoluteFill: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n}\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": "AAkCU,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAkCU;AAlCV;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AAGvB;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,SAA8B,QAAQ;AACtD,YAAM,QAAQ,oBAAoB,OAAO;AACzC,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aACE,oBAAC,uBAAoB,KAAkB,GAAG,YACxC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO;AAAA,UAEN;AAAA;AAAA,MACH,GACF;AAAA,IAEJ,CAAC;AAAA,EACH;AACF;AAEA,MAAM,eAA0B;AAAA,EAC9B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;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,CAAC,MAAM,KAAK;AACpB,aAAO,YAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
getVariable,
|
|
4
|
+
styled,
|
|
5
|
+
themeable,
|
|
6
|
+
useMediaPropsActive,
|
|
7
|
+
useTheme
|
|
8
|
+
} from "@tamagui/core";
|
|
9
|
+
import { YStack } from "@tamagui/stacks";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import {
|
|
12
|
+
LinearGradient as ExpoLinearGradient
|
|
13
|
+
} from "./linear-gradient";
|
|
14
|
+
const LinearGradient = YStack.extractable(
|
|
15
|
+
themeable(
|
|
16
|
+
React.forwardRef((propsIn, ref) => {
|
|
17
|
+
const props = useMediaPropsActive(propsIn);
|
|
18
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
19
|
+
const colors = useThemeColors(colorsProp || []);
|
|
20
|
+
return /* @__PURE__ */ jsx(LinearGradientFrame, { ref, ...stackProps, children: /* @__PURE__ */ jsx(
|
|
21
|
+
ExpoLinearGradient,
|
|
22
|
+
{
|
|
23
|
+
start,
|
|
24
|
+
end,
|
|
25
|
+
colors,
|
|
26
|
+
locations,
|
|
27
|
+
style: absoluteFill,
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
) });
|
|
31
|
+
})
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
const absoluteFill = {
|
|
35
|
+
position: "absolute",
|
|
36
|
+
top: 0,
|
|
37
|
+
left: 0,
|
|
38
|
+
right: 0,
|
|
39
|
+
bottom: 0
|
|
40
|
+
};
|
|
41
|
+
const LinearGradientFrame = styled(YStack, {
|
|
42
|
+
name: "LinearGradient",
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
position: "relative"
|
|
45
|
+
});
|
|
46
|
+
const useThemeColors = (colors) => {
|
|
47
|
+
const theme = useTheme();
|
|
48
|
+
return colors.map((color) => {
|
|
49
|
+
if (color[0] === "$") {
|
|
50
|
+
return getVariable(theme[color] || color);
|
|
51
|
+
}
|
|
52
|
+
return color;
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
LinearGradient
|
|
57
|
+
};
|
|
2
58
|
//# sourceMappingURL=LinearGradient.shared.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n ThemeTokens,\n getVariable,\n styled,\n themeable,\n useMediaPropsActive,\n useTheme,\n} from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport type { View, ViewStyle } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from './linear-gradient'\n\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((propsIn: LinearGradientProps, ref) => {\n const props = useMediaPropsActive(propsIn)\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n <LinearGradientFrame ref={ref as any} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={absoluteFill}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst absoluteFill: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n}\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": "AAkCU,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAkCU;AAlCV;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AAGvB;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,SAA8B,QAAQ;AACtD,YAAM,QAAQ,oBAAoB,OAAO;AACzC,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aACE,oBAAC,uBAAoB,KAAkB,GAAG,YACxC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,OAAO;AAAA,UAEN;AAAA;AAAA,MACH,GACF;AAAA,IAEJ,CAAC;AAAA,EACH;AACF;AAEA,MAAM,eAA0B;AAAA,EAC9B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;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,CAAC,MAAM,KAAK;AACpB,aAAO,YAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient";
|
|
1
|
+
export * from "./LinearGradient";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient";
|
|
1
|
+
export * from "./LinearGradient";
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linear-gradient.ts"],
|
|
4
4
|
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linear-gradient.ts"],
|
|
4
4
|
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient.shared";
|
|
1
|
+
export * from "./LinearGradient.shared";
|
|
2
2
|
//# sourceMappingURL=LinearGradient.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient.shared";
|
|
1
|
+
export * from "./LinearGradient.shared";
|
|
2
2
|
//# sourceMappingURL=LinearGradient.mjs.map
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
function
|
|
1
|
+
function LinearGradient(props) {
|
|
2
|
+
const Real = require("./LinearGradient.shared").LinearGradient;
|
|
3
|
+
return <Real {...props} />;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
LinearGradient
|
|
7
|
+
};
|
|
2
8
|
//# sourceMappingURL=LinearGradient.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.native.tsx"],
|
|
4
4
|
"sourcesContent": ["/**\n * Fake file require just so native users can avoid installing\n * expo stuff up front for native.\n */\n\nexport function LinearGradient(props) {\n const Real = require('./LinearGradient.shared').LinearGradient\n\n return <Real {...props} />\n}\n"],
|
|
5
|
-
"mappings": "AAKO,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAKO,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,CAAC,SAAS,OAAO;AAC1B;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
function
|
|
1
|
+
function LinearGradient(props) {
|
|
2
|
+
const Real = require("./LinearGradient.shared").LinearGradient;
|
|
3
|
+
return <Real {...props} />;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
LinearGradient
|
|
7
|
+
};
|
|
2
8
|
//# sourceMappingURL=LinearGradient.native.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.native.tsx"],
|
|
4
4
|
"sourcesContent": ["/**\n * Fake file require just so native users can avoid installing\n * expo stuff up front for native.\n */\n\nexport function LinearGradient(props) {\n const Real = require('./LinearGradient.shared').LinearGradient\n\n return <Real {...props} />\n}\n"],
|
|
5
|
-
"mappings": "AAKO,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAKO,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,CAAC,SAAS,OAAO;AAC1B;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,53 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
getVariable,
|
|
3
|
+
styled,
|
|
4
|
+
themeable,
|
|
5
|
+
useMediaPropsActive,
|
|
6
|
+
useTheme
|
|
7
|
+
} from "@tamagui/core";
|
|
8
|
+
import { YStack } from "@tamagui/stacks";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import {
|
|
11
|
+
LinearGradient as ExpoLinearGradient
|
|
12
|
+
} from "./linear-gradient";
|
|
13
|
+
const LinearGradient = YStack.extractable(
|
|
14
|
+
themeable(
|
|
15
|
+
React.forwardRef((propsIn, ref) => {
|
|
16
|
+
const props = useMediaPropsActive(propsIn);
|
|
17
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
18
|
+
const colors = useThemeColors(colorsProp || []);
|
|
19
|
+
return <LinearGradientFrame ref={ref} {...stackProps}><ExpoLinearGradient
|
|
20
|
+
start={start}
|
|
21
|
+
end={end}
|
|
22
|
+
colors={colors}
|
|
23
|
+
locations={locations}
|
|
24
|
+
style={absoluteFill}
|
|
25
|
+
>{children}</ExpoLinearGradient></LinearGradientFrame>;
|
|
26
|
+
})
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
const absoluteFill = {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
top: 0,
|
|
32
|
+
left: 0,
|
|
33
|
+
right: 0,
|
|
34
|
+
bottom: 0
|
|
35
|
+
};
|
|
36
|
+
const LinearGradientFrame = styled(YStack, {
|
|
37
|
+
name: "LinearGradient",
|
|
38
|
+
overflow: "hidden",
|
|
39
|
+
position: "relative"
|
|
40
|
+
});
|
|
41
|
+
const useThemeColors = (colors) => {
|
|
42
|
+
const theme = useTheme();
|
|
43
|
+
return colors.map((color) => {
|
|
44
|
+
if (color[0] === "$") {
|
|
45
|
+
return getVariable(theme[color] || color);
|
|
46
|
+
}
|
|
47
|
+
return color;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
LinearGradient
|
|
52
|
+
};
|
|
2
53
|
//# sourceMappingURL=LinearGradient.shared.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n ThemeTokens,\n getVariable,\n styled,\n themeable,\n useMediaPropsActive,\n useTheme,\n} from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport type { View, ViewStyle } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from './linear-gradient'\n\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((propsIn: LinearGradientProps, ref) => {\n const props = useMediaPropsActive(propsIn)\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n <LinearGradientFrame ref={ref as any} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={absoluteFill}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst absoluteFill: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n}\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,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AAGvB;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,SAA8B,QAAQ;AACtD,YAAM,QAAQ,oBAAoB,OAAO;AACzC,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aACE,CAAC,oBAAoB,KAAK,SAAgB,YACxC,CAAC;AAAA,QACC,OAAO;AAAA,QACP,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,OAAO;AAAA,QAEN,SACH,EARC,mBASH,EAVC;AAAA,IAYL,CAAC;AAAA,EACH;AACF;AAEA,MAAM,eAA0B;AAAA,EAC9B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;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,CAAC,MAAM,KAAK;AACpB,aAAO,YAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,53 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
getVariable,
|
|
3
|
+
styled,
|
|
4
|
+
themeable,
|
|
5
|
+
useMediaPropsActive,
|
|
6
|
+
useTheme
|
|
7
|
+
} from "@tamagui/core";
|
|
8
|
+
import { YStack } from "@tamagui/stacks";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import {
|
|
11
|
+
LinearGradient as ExpoLinearGradient
|
|
12
|
+
} from "./linear-gradient";
|
|
13
|
+
const LinearGradient = YStack.extractable(
|
|
14
|
+
themeable(
|
|
15
|
+
React.forwardRef((propsIn, ref) => {
|
|
16
|
+
const props = useMediaPropsActive(propsIn);
|
|
17
|
+
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
18
|
+
const colors = useThemeColors(colorsProp || []);
|
|
19
|
+
return <LinearGradientFrame ref={ref} {...stackProps}><ExpoLinearGradient
|
|
20
|
+
start={start}
|
|
21
|
+
end={end}
|
|
22
|
+
colors={colors}
|
|
23
|
+
locations={locations}
|
|
24
|
+
style={absoluteFill}
|
|
25
|
+
>{children}</ExpoLinearGradient></LinearGradientFrame>;
|
|
26
|
+
})
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
const absoluteFill = {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
top: 0,
|
|
32
|
+
left: 0,
|
|
33
|
+
right: 0,
|
|
34
|
+
bottom: 0
|
|
35
|
+
};
|
|
36
|
+
const LinearGradientFrame = styled(YStack, {
|
|
37
|
+
name: "LinearGradient",
|
|
38
|
+
overflow: "hidden",
|
|
39
|
+
position: "relative"
|
|
40
|
+
});
|
|
41
|
+
const useThemeColors = (colors) => {
|
|
42
|
+
const theme = useTheme();
|
|
43
|
+
return colors.map((color) => {
|
|
44
|
+
if (color[0] === "$") {
|
|
45
|
+
return getVariable(theme[color] || color);
|
|
46
|
+
}
|
|
47
|
+
return color;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
LinearGradient
|
|
52
|
+
};
|
|
2
53
|
//# sourceMappingURL=LinearGradient.shared.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n ColorTokens,\n ThemeTokens,\n getVariable,\n styled,\n themeable,\n useMediaPropsActive,\n useTheme,\n} from '@tamagui/core'\nimport { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\nimport type { View, ViewStyle } from 'react-native'\n\nimport {\n LinearGradient as ExpoLinearGradient,\n LinearGradientProps as ExpoLinearGradientProps,\n} from './linear-gradient'\n\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((propsIn: LinearGradientProps, ref) => {\n const props = useMediaPropsActive(propsIn)\n const { start, end, colors: colorsProp, locations, children, ...stackProps } = props\n const colors = useThemeColors(colorsProp || [])\n return (\n <LinearGradientFrame ref={ref as any} {...stackProps}>\n <ExpoLinearGradient\n start={start}\n end={end}\n colors={colors}\n locations={locations}\n style={absoluteFill}\n >\n {children}\n </ExpoLinearGradient>\n </LinearGradientFrame>\n )\n })\n )\n) as any\n\nconst absoluteFill: ViewStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n}\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,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AAGvB;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,SAA8B,QAAQ;AACtD,YAAM,QAAQ,oBAAoB,OAAO;AACzC,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C,aACE,CAAC,oBAAoB,KAAK,SAAgB,YACxC,CAAC;AAAA,QACC,OAAO;AAAA,QACP,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,OAAO;AAAA,QAEN,SACH,EARC,mBASH,EAVC;AAAA,IAYL,CAAC;AAAA,EACH;AACF;AAEA,MAAM,eAA0B;AAAA,EAC9B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;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,CAAC,MAAM,KAAK;AACpB,aAAO,YAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/jsx/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient";
|
|
1
|
+
export * from "./LinearGradient";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/jsx/index.js.map
CHANGED
package/dist/jsx/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./LinearGradient";
|
|
1
|
+
export * from "./LinearGradient";
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/jsx/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linear-gradient.ts"],
|
|
4
4
|
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linear-gradient.ts"],
|
|
4
4
|
"sourcesContent": ["export { LinearGradient } from 'expo-linear-gradient'\nexport type { LinearGradientProps } from 'expo-linear-gradient'\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/linear-gradient",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.3",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tamagui/core": "1.14.
|
|
35
|
-
"@tamagui/stacks": "1.14.
|
|
34
|
+
"@tamagui/core": "1.14.3",
|
|
35
|
+
"@tamagui/stacks": "1.14.3"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "*"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@tamagui/build": "1.14.
|
|
41
|
+
"@tamagui/build": "1.14.3",
|
|
42
42
|
"expo-linear-gradient": "^12.0.1",
|
|
43
43
|
"react": "^18.2.0"
|
|
44
44
|
},
|