@tamagui/linear-gradient 1.89.29 → 1.90.0
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.shared.native.js +87 -30
- package/dist/cjs/LinearGradient.shared.native.js.map +3 -3
- package/dist/esm/LinearGradient.shared.native.js +87 -30
- package/dist/esm/LinearGradient.shared.native.js.map +3 -3
- package/dist/jsx/LinearGradient.shared.native.js +87 -30
- package/dist/jsx/LinearGradient.shared.native.js.map +3 -3
- package/package.json +4 -4
- package/types/LinearGradient.native.d.ts +1 -2
- package/types/LinearGradient.native.d.ts.map +1 -1
|
@@ -18,40 +18,97 @@ __export(LinearGradient_shared_exports, {
|
|
|
18
18
|
LinearGradient: () => LinearGradient
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(LinearGradient_shared_exports);
|
|
21
|
-
var import_core = require("@tamagui/core"), import_stacks = require("@tamagui/stacks"), import_linear_gradient = require("./linear-gradient")
|
|
22
|
-
|
|
21
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_core = require("@tamagui/core"), import_stacks = require("@tamagui/stacks"), import_linear_gradient = require("./linear-gradient");
|
|
22
|
+
function _define_property(obj, key, value) {
|
|
23
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
24
|
+
value,
|
|
25
|
+
enumerable: !0,
|
|
26
|
+
configurable: !0,
|
|
27
|
+
writable: !0
|
|
28
|
+
}) : obj[key] = value, obj;
|
|
29
|
+
}
|
|
30
|
+
function _object_spread(target) {
|
|
31
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
32
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
33
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
34
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
35
|
+
}))), ownKeys2.forEach(function(key) {
|
|
36
|
+
_define_property(target, key, source[key]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
}
|
|
41
|
+
function ownKeys(object, enumerableOnly) {
|
|
42
|
+
var keys = Object.keys(object);
|
|
43
|
+
if (Object.getOwnPropertySymbols) {
|
|
44
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
45
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
46
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
47
|
+
})), keys.push.apply(keys, symbols);
|
|
48
|
+
}
|
|
49
|
+
return keys;
|
|
50
|
+
}
|
|
51
|
+
function _object_spread_props(target, source) {
|
|
52
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
53
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
54
|
+
}), target;
|
|
55
|
+
}
|
|
56
|
+
function _object_without_properties(source, excluded) {
|
|
57
|
+
if (source == null)
|
|
58
|
+
return {};
|
|
59
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
60
|
+
if (Object.getOwnPropertySymbols) {
|
|
61
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
62
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
63
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
64
|
+
}
|
|
65
|
+
return target;
|
|
66
|
+
}
|
|
67
|
+
function _object_without_properties_loose(source, excluded) {
|
|
68
|
+
if (source == null)
|
|
69
|
+
return {};
|
|
70
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
71
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
72
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
73
|
+
return target;
|
|
74
|
+
}
|
|
75
|
+
var LinearGradientFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
23
76
|
name: "LinearGradient",
|
|
24
77
|
overflow: "hidden",
|
|
25
78
|
position: "relative"
|
|
26
|
-
}), LinearGradient = LinearGradientFrame.styleable(
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
79
|
+
}), LinearGradient = LinearGradientFrame.styleable(function(propsIn, ref) {
|
|
80
|
+
var _props_colors, props = (0, import_core.useProps)(propsIn), start = props.start, end = props.end, colorsProp = props.colors, locations = props.locations, children = props.children, stackProps = _object_without_properties(props, [
|
|
81
|
+
"start",
|
|
82
|
+
"end",
|
|
83
|
+
"colors",
|
|
84
|
+
"locations",
|
|
85
|
+
"children"
|
|
86
|
+
]), theme = (0, import_core.useTheme)(), colors = ((_props_colors = props.colors) === null || _props_colors === void 0 ? void 0 : _props_colors.map(function(c) {
|
|
87
|
+
var _theme_c, _theme_c_get;
|
|
88
|
+
return (_theme_c_get = (_theme_c = theme[c]) === null || _theme_c === void 0 ? void 0 : _theme_c.get("web")) !== null && _theme_c_get !== void 0 ? _theme_c_get : c;
|
|
89
|
+
})) || [];
|
|
90
|
+
return process.env.NODE_ENV !== "production" && colors.some(function(c) {
|
|
91
|
+
var normalized = (0, import_core.normalizeColor)(c);
|
|
92
|
+
if (!normalized || normalized.startsWith("$"))
|
|
93
|
+
return !0;
|
|
94
|
+
}) && (console.error('LinearGradient: "colors" prop contains invalid color tokens: '.concat(colors, ' fallback to default colors: ["#000", "#fff"]')), colors = [
|
|
95
|
+
"#000",
|
|
96
|
+
"#fff"
|
|
97
|
+
]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(LinearGradientFrame, _object_spread_props(_object_spread({
|
|
98
|
+
ref
|
|
99
|
+
}, stackProps), {
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_linear_gradient.LinearGradient, {
|
|
102
|
+
start,
|
|
103
|
+
end,
|
|
104
|
+
colors,
|
|
105
|
+
locations,
|
|
106
|
+
style: gradientStyle
|
|
107
|
+
}),
|
|
51
108
|
children
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
), gradientStyle = {
|
|
109
|
+
]
|
|
110
|
+
}));
|
|
111
|
+
}), gradientStyle = {
|
|
55
112
|
position: "absolute",
|
|
56
113
|
top: 0,
|
|
57
114
|
left: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/linear-gradient/src/LinearGradient.shared.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;uDACA,cAA2D,0BAC3D,gBAAuB,4BAIvB,yBAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUrD,IAAMA,0BAAsBC,oBAAOC,sBAAQ;EACzCC,MAAM;EACNC,UAAU;EACVC,UAAU;AACZ,CAAA,GAEaC,iBAAiBN,oBAAoBO,UAChD,SAACC,SAASC,KAAAA;MAONC,eANIA,YAAQC,sBAASH,OAAAA,GAEfI,QAAuEF,MAAvEE,OAAOC,MAAgEH,MAAhEG,KAAaC,aAAmDJ,MAA3DK,QAAoBC,YAAuCN,MAAvCM,WAAWC,WAA4BP,MAA5BO,UAAaC,aAAAA,2BAAeR,OAAAA;IAAvEE;IAAOC;IAAKE;IAAoBC;IAAWC;MAC7CE,YAAQC,sBAAAA,GAEVL,WACFL,gBAAAA,MAAMK,YAAM,QAAZL,kBAAAA,SAAAA,SAAAA,cAAcW,IAAI,SAACC,GAAAA;QACTH,UAAAA;AAAR,YAAQA,gBAAAA,WAAAA,MAAMG,CAAAA,OAAE,QAARH,aAAAA,SAAAA,SAAAA,SAAUI,IAAI,KAAA,OAAA,QAAdJ,iBAAAA,SAAAA,eAAmCG;EAC7C,CAAA,MAAM,CAAA;AAER,SAAIE,QAAQC,IAAIC,aAAa,gBAEzBX,OAAOY,KAAK,SAACL,GAAAA;AACX,QAAMM,iBAAaC,4BAAeP,CAAAA;AAClC,QAAI,CAACM,cAAcA,WAAWE,WAAW,GAAA;AACvC,aAAO;EAEX,CAAA,MAEAC,QAAQC,MACL,gEAAsE,OAAPjB,QAAO,+CAAA,CAAA,GAEzEA,SAAS;IAAC;IAAQ;MAKpB,uCAAAkB,MAACjC,qBAAAA,qBAAAA,eAAAA;IAAoBS;KAAqBS,UAAAA,GAAAA;;MACxC,uCAAAgB,KAACC,uBAAAA,gBAAAA;QACCvB;QACAC;QACAE;QACAC;QACAoB,OAAOC;;MAERpB;;;AAGP,CAAA,GAKIoB,gBAA2B;EAC/BhC,UAAU;EACViC,KAAK;EACLC,MAAM;EACNC,OAAO;EACPC,QAAQ;EACRC,QAAQ;AACV;",
|
|
5
|
+
"names": ["LinearGradientFrame", "styled", "YStack", "name", "overflow", "position", "LinearGradient", "styleable", "propsIn", "ref", "props", "useProps", "start", "end", "colorsProp", "colors", "locations", "children", "stackProps", "theme", "useTheme", "map", "c", "get", "process", "env", "NODE_ENV", "some", "normalized", "normalizeColor", "startsWith", "console", "error", "_jsxs", "_jsx", "ExpoLinearGradient", "style", "gradientStyle", "top", "left", "right", "bottom", "zIndex"]
|
|
6
6
|
}
|
|
@@ -1,40 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { normalizeColor, styled, useProps, useTheme } from "@tamagui/core";
|
|
2
3
|
import { YStack } from "@tamagui/stacks";
|
|
3
4
|
import { LinearGradient as ExpoLinearGradient } from "./linear-gradient";
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
function _define_property(obj, key, value) {
|
|
6
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
7
|
+
value,
|
|
8
|
+
enumerable: !0,
|
|
9
|
+
configurable: !0,
|
|
10
|
+
writable: !0
|
|
11
|
+
}) : obj[key] = value, obj;
|
|
12
|
+
}
|
|
13
|
+
function _object_spread(target) {
|
|
14
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
16
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
17
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
18
|
+
}))), ownKeys2.forEach(function(key) {
|
|
19
|
+
_define_property(target, key, source[key]);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return target;
|
|
23
|
+
}
|
|
24
|
+
function ownKeys(object, enumerableOnly) {
|
|
25
|
+
var keys = Object.keys(object);
|
|
26
|
+
if (Object.getOwnPropertySymbols) {
|
|
27
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
28
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
29
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
30
|
+
})), keys.push.apply(keys, symbols);
|
|
31
|
+
}
|
|
32
|
+
return keys;
|
|
33
|
+
}
|
|
34
|
+
function _object_spread_props(target, source) {
|
|
35
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
36
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
37
|
+
}), target;
|
|
38
|
+
}
|
|
39
|
+
function _object_without_properties(source, excluded) {
|
|
40
|
+
if (source == null)
|
|
41
|
+
return {};
|
|
42
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
43
|
+
if (Object.getOwnPropertySymbols) {
|
|
44
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
46
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
47
|
+
}
|
|
48
|
+
return target;
|
|
49
|
+
}
|
|
50
|
+
function _object_without_properties_loose(source, excluded) {
|
|
51
|
+
if (source == null)
|
|
52
|
+
return {};
|
|
53
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
54
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
55
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
56
|
+
return target;
|
|
57
|
+
}
|
|
58
|
+
var LinearGradientFrame = styled(YStack, {
|
|
6
59
|
name: "LinearGradient",
|
|
7
60
|
overflow: "hidden",
|
|
8
61
|
position: "relative"
|
|
9
|
-
}), LinearGradient = LinearGradientFrame.styleable(
|
|
10
|
-
(propsIn,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
62
|
+
}), LinearGradient = LinearGradientFrame.styleable(function(propsIn, ref) {
|
|
63
|
+
var _props_colors, props = useProps(propsIn), start = props.start, end = props.end, colorsProp = props.colors, locations = props.locations, children = props.children, stackProps = _object_without_properties(props, [
|
|
64
|
+
"start",
|
|
65
|
+
"end",
|
|
66
|
+
"colors",
|
|
67
|
+
"locations",
|
|
68
|
+
"children"
|
|
69
|
+
]), theme = useTheme(), colors = ((_props_colors = props.colors) === null || _props_colors === void 0 ? void 0 : _props_colors.map(function(c) {
|
|
70
|
+
var _theme_c, _theme_c_get;
|
|
71
|
+
return (_theme_c_get = (_theme_c = theme[c]) === null || _theme_c === void 0 ? void 0 : _theme_c.get("web")) !== null && _theme_c_get !== void 0 ? _theme_c_get : c;
|
|
72
|
+
})) || [];
|
|
73
|
+
return process.env.NODE_ENV !== "production" && colors.some(function(c) {
|
|
74
|
+
var normalized = normalizeColor(c);
|
|
75
|
+
if (!normalized || normalized.startsWith("$"))
|
|
76
|
+
return !0;
|
|
77
|
+
}) && (console.error('LinearGradient: "colors" prop contains invalid color tokens: '.concat(colors, ' fallback to default colors: ["#000", "#fff"]')), colors = [
|
|
78
|
+
"#000",
|
|
79
|
+
"#fff"
|
|
80
|
+
]), /* @__PURE__ */ _jsxs(LinearGradientFrame, _object_spread_props(_object_spread({
|
|
81
|
+
ref
|
|
82
|
+
}, stackProps), {
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ _jsx(ExpoLinearGradient, {
|
|
85
|
+
start,
|
|
86
|
+
end,
|
|
87
|
+
colors,
|
|
88
|
+
locations,
|
|
89
|
+
style: gradientStyle
|
|
90
|
+
}),
|
|
34
91
|
children
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
), gradientStyle = {
|
|
92
|
+
]
|
|
93
|
+
}));
|
|
94
|
+
}), gradientStyle = {
|
|
38
95
|
position: "absolute",
|
|
39
96
|
top: 0,
|
|
40
97
|
left: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
|
-
"mappings": "AACA,
|
|
5
|
-
"names": ["
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/linear-gradient/src/LinearGradient.shared.tsx"],
|
|
4
|
+
"mappings": ";AACA,SAASA,gBAAgBC,QAAQC,UAAUC,gBAAgB;AAC3D,SAASC,cAAc;AAIvB,SAASC,kBAAkBC,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUrD,IAAMC,sBAAsBN,OAAOG,QAAQ;EACzCI,MAAM;EACNC,UAAU;EACVC,UAAU;AACZ,CAAA,GAEaL,iBAAiBE,oBAAoBI,UAChD,SAACC,SAASC,KAAAA;MAONC,eANIA,QAAQZ,SAASU,OAAAA,GAEfG,QAAuED,MAAvEC,OAAOC,MAAgEF,MAAhEE,KAAaC,aAAmDH,MAA3DI,QAAoBC,YAAuCL,MAAvCK,WAAWC,WAA4BN,MAA5BM,UAAaC,aAAAA,2BAAeP,OAAAA;IAAvEC;IAAOC;IAAKE;IAAoBC;IAAWC;MAC7CE,QAAQnB,SAAAA,GAEVe,WACFJ,gBAAAA,MAAMI,YAAM,QAAZJ,kBAAAA,SAAAA,SAAAA,cAAcS,IAAI,SAACC,GAAAA;QACTF,UAAAA;AAAR,YAAQA,gBAAAA,WAAAA,MAAME,CAAAA,OAAE,QAARF,aAAAA,SAAAA,SAAAA,SAAUG,IAAI,KAAA,OAAA,QAAdH,iBAAAA,SAAAA,eAAmCE;EAC7C,CAAA,MAAM,CAAA;AAER,SAAIE,QAAQC,IAAIC,aAAa,gBAEzBV,OAAOW,KAAK,SAACL,GAAAA;AACX,QAAMM,aAAa9B,eAAewB,CAAAA;AAClC,QAAI,CAACM,cAAcA,WAAWC,WAAW,GAAA;AACvC,aAAO;EAEX,CAAA,MAEAC,QAAQC,MACL,gEAAsE,OAAPf,QAAO,+CAAA,CAAA,GAEzEA,SAAS;IAAC;IAAQ;MAKpB,sBAACX,qBAAAA,qBAAAA,eAAAA;IAAoBM;KAAqBQ,UAAAA,GAAAA;;MACxC,qBAACf,oBAAAA;QACCS;QACAC;QACAE;QACAC;QACAe,OAAOC;;MAERf;;;AAGP,CAAA,GAKIe,gBAA2B;EAC/BzB,UAAU;EACV0B,KAAK;EACLC,MAAM;EACNC,OAAO;EACPC,QAAQ;EACRC,QAAQ;AACV;",
|
|
5
|
+
"names": ["normalizeColor", "styled", "useProps", "useTheme", "YStack", "LinearGradient", "ExpoLinearGradient", "LinearGradientFrame", "name", "overflow", "position", "styleable", "propsIn", "ref", "props", "start", "end", "colorsProp", "colors", "locations", "children", "stackProps", "theme", "map", "c", "get", "process", "env", "NODE_ENV", "some", "normalized", "startsWith", "console", "error", "style", "gradientStyle", "top", "left", "right", "bottom", "zIndex"]
|
|
6
6
|
}
|
|
@@ -1,40 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { normalizeColor, styled, useProps, useTheme } from "@tamagui/core";
|
|
2
3
|
import { YStack } from "@tamagui/stacks";
|
|
3
4
|
import { LinearGradient as ExpoLinearGradient } from "./linear-gradient";
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
function _define_property(obj, key, value) {
|
|
6
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
7
|
+
value,
|
|
8
|
+
enumerable: !0,
|
|
9
|
+
configurable: !0,
|
|
10
|
+
writable: !0
|
|
11
|
+
}) : obj[key] = value, obj;
|
|
12
|
+
}
|
|
13
|
+
function _object_spread(target) {
|
|
14
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
16
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
17
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
18
|
+
}))), ownKeys2.forEach(function(key) {
|
|
19
|
+
_define_property(target, key, source[key]);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return target;
|
|
23
|
+
}
|
|
24
|
+
function ownKeys(object, enumerableOnly) {
|
|
25
|
+
var keys = Object.keys(object);
|
|
26
|
+
if (Object.getOwnPropertySymbols) {
|
|
27
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
28
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
29
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
30
|
+
})), keys.push.apply(keys, symbols);
|
|
31
|
+
}
|
|
32
|
+
return keys;
|
|
33
|
+
}
|
|
34
|
+
function _object_spread_props(target, source) {
|
|
35
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
36
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
37
|
+
}), target;
|
|
38
|
+
}
|
|
39
|
+
function _object_without_properties(source, excluded) {
|
|
40
|
+
if (source == null)
|
|
41
|
+
return {};
|
|
42
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
43
|
+
if (Object.getOwnPropertySymbols) {
|
|
44
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
46
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
47
|
+
}
|
|
48
|
+
return target;
|
|
49
|
+
}
|
|
50
|
+
function _object_without_properties_loose(source, excluded) {
|
|
51
|
+
if (source == null)
|
|
52
|
+
return {};
|
|
53
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
54
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
55
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
56
|
+
return target;
|
|
57
|
+
}
|
|
58
|
+
var LinearGradientFrame = styled(YStack, {
|
|
6
59
|
name: "LinearGradient",
|
|
7
60
|
overflow: "hidden",
|
|
8
61
|
position: "relative"
|
|
9
|
-
}), LinearGradient = LinearGradientFrame.styleable(
|
|
10
|
-
(propsIn,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
62
|
+
}), LinearGradient = LinearGradientFrame.styleable(function(propsIn, ref) {
|
|
63
|
+
var _props_colors, props = useProps(propsIn), start = props.start, end = props.end, colorsProp = props.colors, locations = props.locations, children = props.children, stackProps = _object_without_properties(props, [
|
|
64
|
+
"start",
|
|
65
|
+
"end",
|
|
66
|
+
"colors",
|
|
67
|
+
"locations",
|
|
68
|
+
"children"
|
|
69
|
+
]), theme = useTheme(), colors = ((_props_colors = props.colors) === null || _props_colors === void 0 ? void 0 : _props_colors.map(function(c) {
|
|
70
|
+
var _theme_c, _theme_c_get;
|
|
71
|
+
return (_theme_c_get = (_theme_c = theme[c]) === null || _theme_c === void 0 ? void 0 : _theme_c.get("web")) !== null && _theme_c_get !== void 0 ? _theme_c_get : c;
|
|
72
|
+
})) || [];
|
|
73
|
+
return process.env.NODE_ENV !== "production" && colors.some(function(c) {
|
|
74
|
+
var normalized = normalizeColor(c);
|
|
75
|
+
if (!normalized || normalized.startsWith("$"))
|
|
76
|
+
return !0;
|
|
77
|
+
}) && (console.error('LinearGradient: "colors" prop contains invalid color tokens: '.concat(colors, ' fallback to default colors: ["#000", "#fff"]')), colors = [
|
|
78
|
+
"#000",
|
|
79
|
+
"#fff"
|
|
80
|
+
]), /* @__PURE__ */ _jsxs(LinearGradientFrame, _object_spread_props(_object_spread({
|
|
81
|
+
ref
|
|
82
|
+
}, stackProps), {
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ _jsx(ExpoLinearGradient, {
|
|
85
|
+
start,
|
|
86
|
+
end,
|
|
87
|
+
colors,
|
|
88
|
+
locations,
|
|
89
|
+
style: gradientStyle
|
|
90
|
+
}),
|
|
34
91
|
children
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
), gradientStyle = {
|
|
92
|
+
]
|
|
93
|
+
}));
|
|
94
|
+
}), gradientStyle = {
|
|
38
95
|
position: "absolute",
|
|
39
96
|
top: 0,
|
|
40
97
|
left: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/LinearGradient.shared.tsx"],
|
|
4
|
-
"mappings": "AACA,
|
|
5
|
-
"names": ["
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/linear-gradient/src/LinearGradient.shared.tsx"],
|
|
4
|
+
"mappings": ";AACA,SAASA,gBAAgBC,QAAQC,UAAUC,gBAAgB;AAC3D,SAASC,cAAc;AAIvB,SAASC,kBAAkBC,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUrD,IAAMC,sBAAsBN,OAAOG,QAAQ;EACzCI,MAAM;EACNC,UAAU;EACVC,UAAU;AACZ,CAAA,GAEaL,iBAAiBE,oBAAoBI,UAChD,SAACC,SAASC,KAAAA;MAONC,eANIA,QAAQZ,SAASU,OAAAA,GAEfG,QAAuED,MAAvEC,OAAOC,MAAgEF,MAAhEE,KAAaC,aAAmDH,MAA3DI,QAAoBC,YAAuCL,MAAvCK,WAAWC,WAA4BN,MAA5BM,UAAaC,aAAAA,2BAAeP,OAAAA;IAAvEC;IAAOC;IAAKE;IAAoBC;IAAWC;MAC7CE,QAAQnB,SAAAA,GAEVe,WACFJ,gBAAAA,MAAMI,YAAM,QAAZJ,kBAAAA,SAAAA,SAAAA,cAAcS,IAAI,SAACC,GAAAA;QACTF,UAAAA;AAAR,YAAQA,gBAAAA,WAAAA,MAAME,CAAAA,OAAE,QAARF,aAAAA,SAAAA,SAAAA,SAAUG,IAAI,KAAA,OAAA,QAAdH,iBAAAA,SAAAA,eAAmCE;EAC7C,CAAA,MAAM,CAAA;AAER,SAAIE,QAAQC,IAAIC,aAAa,gBAEzBV,OAAOW,KAAK,SAACL,GAAAA;AACX,QAAMM,aAAa9B,eAAewB,CAAAA;AAClC,QAAI,CAACM,cAAcA,WAAWC,WAAW,GAAA;AACvC,aAAO;EAEX,CAAA,MAEAC,QAAQC,MACL,gEAAsE,OAAPf,QAAO,+CAAA,CAAA,GAEzEA,SAAS;IAAC;IAAQ;MAKpB,sBAACX,qBAAAA,qBAAAA,eAAAA;IAAoBM;KAAqBQ,UAAAA,GAAAA;;MACxC,qBAACf,oBAAAA;QACCS;QACAC;QACAE;QACAC;QACAe,OAAOC;;MAERf;;;AAGP,CAAA,GAKIe,gBAA2B;EAC/BzB,UAAU;EACV0B,KAAK;EACLC,MAAM;EACNC,OAAO;EACPC,QAAQ;EACRC,QAAQ;AACV;",
|
|
5
|
+
"names": ["normalizeColor", "styled", "useProps", "useTheme", "YStack", "LinearGradient", "ExpoLinearGradient", "LinearGradientFrame", "name", "overflow", "position", "styleable", "propsIn", "ref", "props", "start", "end", "colorsProp", "colors", "locations", "children", "stackProps", "theme", "map", "c", "get", "process", "env", "NODE_ENV", "some", "normalized", "startsWith", "console", "error", "style", "gradientStyle", "top", "left", "right", "bottom", "zIndex"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/linear-gradient",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.90.0",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@tamagui/core": "1.
|
|
36
|
-
"@tamagui/stacks": "1.
|
|
35
|
+
"@tamagui/core": "1.90.0",
|
|
36
|
+
"@tamagui/stacks": "1.90.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "*"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.
|
|
42
|
+
"@tamagui/build": "1.90.0",
|
|
43
43
|
"expo-linear-gradient": "^12.7.1",
|
|
44
44
|
"react": "^18.2.0"
|
|
45
45
|
},
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
* Fake file require just so native users can avoid installing
|
|
3
3
|
* expo stuff up front for native.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
export declare function LinearGradient(props: any): JSX.Element;
|
|
5
|
+
export declare function LinearGradient(props: any): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
//# sourceMappingURL=LinearGradient.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearGradient.native.d.ts","sourceRoot":"","sources":["../src/LinearGradient.native.tsx"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"LinearGradient.native.d.ts","sourceRoot":"","sources":["../src/LinearGradient.native.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,cAAc,CAAC,KAAK,KAAA,2CAGnC"}
|