@tamagui/linear-gradient 1.1.7 → 1.1.9
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.native.js +1 -3
- package/dist/cjs/LinearGradient.native.js.map +1 -1
- package/dist/cjs/LinearGradient.shared.js +18 -12
- package/dist/cjs/LinearGradient.shared.js.map +1 -1
- package/dist/esm/LinearGradient.native.js +1 -3
- package/dist/esm/LinearGradient.native.js.map +1 -1
- package/dist/esm/LinearGradient.shared.js +14 -12
- package/dist/esm/LinearGradient.shared.js.map +1 -1
- package/dist/jsx/LinearGradient.shared.js +10 -1
- package/dist/jsx/LinearGradient.shared.js.map +1 -1
- package/package.json +4 -4
|
@@ -24,9 +24,7 @@ module.exports = __toCommonJS(LinearGradient_native_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
function LinearGradient(props) {
|
|
26
26
|
const Real = require("./LinearGradient.shared").LinearGradient;
|
|
27
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Real, {
|
|
28
|
-
...props
|
|
29
|
-
});
|
|
27
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Real, { ...props });
|
|
30
28
|
}
|
|
31
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
30
|
0 && (module.exports = {
|
|
@@ -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\nimport { View } from 'react-native'\n\nexport function LinearGradient(props) {\n const Real = require('./LinearGradient.shared').LinearGradient\n\n return <Real {...props} />\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUS;AAHF,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,4CAAC
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUS;AAHF,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,4CAAC,QAAM,GAAG,OAAO;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
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.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -38,18 +42,20 @@ const LinearGradient = import_stacks.YStack.extractable(
|
|
|
38
42
|
React.forwardRef((props, ref) => {
|
|
39
43
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
40
44
|
const colors = useThemeColors(colorsProp || []);
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
...stackProps,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
return (
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LinearGradientFrame, { ref, ...stackProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
import_linear_gradient.LinearGradient,
|
|
49
|
+
{
|
|
50
|
+
start,
|
|
51
|
+
end,
|
|
52
|
+
colors,
|
|
53
|
+
locations,
|
|
54
|
+
style: import_react_native.StyleSheet.absoluteFill,
|
|
55
|
+
children
|
|
56
|
+
}
|
|
57
|
+
) })
|
|
58
|
+
);
|
|
53
59
|
})
|
|
54
60
|
)
|
|
55
61
|
);
|
|
@@ -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 useTheme,\n} 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 './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((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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCU;AAjCV,kBAOO;AACP,oBAAoC;AACpC,YAAuB;AACvB,0BAAiC;AAEjC,6BAGO;AAQA,MAAM,iBAET,qBAAO;AAAA,MACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C;AAAA;AAAA,QAEE,4CAAC,uBAAoB,KAAW,GAAG,YACjC;AAAA,UAAC,uBAAAA;AAAA,UAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO,+BAAW;AAAA,YAEjB;AAAA;AAAA,QACH,GACF;AAAA;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,CAAC,MAAM,KAAK;AACpB,iBAAO,yBAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
6
|
"names": ["ExpoLinearGradient"]
|
|
7
7
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
function LinearGradient(props) {
|
|
3
3
|
const Real = require("./LinearGradient.shared").LinearGradient;
|
|
4
|
-
return /* @__PURE__ */ jsx(Real, {
|
|
5
|
-
...props
|
|
6
|
-
});
|
|
4
|
+
return /* @__PURE__ */ jsx(Real, { ...props });
|
|
7
5
|
}
|
|
8
6
|
export {
|
|
9
7
|
LinearGradient
|
|
@@ -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\nimport { View } from 'react-native'\n\nexport function LinearGradient(props) {\n const Real = require('./LinearGradient.shared').LinearGradient\n\n return <Real {...props} />\n}\n"],
|
|
5
|
-
"mappings": "AAUS;AAHF,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,oBAAC
|
|
5
|
+
"mappings": "AAUS;AAHF,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,oBAAC,QAAM,GAAG,OAAO;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -16,18 +16,20 @@ const LinearGradient = YStack.extractable(
|
|
|
16
16
|
React.forwardRef((props, ref) => {
|
|
17
17
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
18
18
|
const colors = useThemeColors(colorsProp || []);
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
...stackProps,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
return (
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
/* @__PURE__ */ jsx(LinearGradientFrame, { ref, ...stackProps, children: /* @__PURE__ */ jsx(
|
|
22
|
+
ExpoLinearGradient,
|
|
23
|
+
{
|
|
24
|
+
start,
|
|
25
|
+
end,
|
|
26
|
+
colors,
|
|
27
|
+
locations,
|
|
28
|
+
style: StyleSheet.absoluteFill,
|
|
29
|
+
children
|
|
30
|
+
}
|
|
31
|
+
) })
|
|
32
|
+
);
|
|
31
33
|
})
|
|
32
34
|
)
|
|
33
35
|
);
|
|
@@ -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 useTheme,\n} 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 './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((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": "AAiCU;AAjCV;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AACvB,SAAS,kBAAwB;AAEjC;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,
|
|
5
|
+
"mappings": "AAiCU;AAjCV;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AACvB,SAAS,kBAAwB;AAEjC;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C;AAAA;AAAA,QAEE,oBAAC,uBAAoB,KAAW,GAAG,YACjC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO,WAAW;AAAA,YAEjB;AAAA;AAAA,QACH,GACF;AAAA;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,CAAC,MAAM,KAAK;AACpB,aAAO,YAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,7 +15,16 @@ const LinearGradient = YStack.extractable(
|
|
|
15
15
|
React.forwardRef((props, ref) => {
|
|
16
16
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
17
17
|
const colors = useThemeColors(colorsProp || []);
|
|
18
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
<LinearGradientFrame ref={ref} {...stackProps}><ExpoLinearGradient
|
|
21
|
+
start={start}
|
|
22
|
+
end={end}
|
|
23
|
+
colors={colors}
|
|
24
|
+
locations={locations}
|
|
25
|
+
style={StyleSheet.absoluteFill}
|
|
26
|
+
>{children}</ExpoLinearGradient></LinearGradientFrame>
|
|
27
|
+
);
|
|
19
28
|
})
|
|
20
29
|
)
|
|
21
30
|
);
|
|
@@ -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 useTheme,\n} 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 './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((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,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AACvB,SAAS,kBAAwB;AAEjC;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,
|
|
5
|
+
"mappings": "AAAA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAA2B;AACpC,YAAY,WAAW;AACvB,SAAS,kBAAwB;AAEjC;AAAA,EACE,kBAAkB;AAAA,OAEb;AAQA,MAAM,iBAET,OAAO;AAAA,EACT;AAAA,IACE,MAAM,WAAW,CAAC,OAA4B,QAAQ;AACpD,YAAM,EAAE,OAAO,KAAK,QAAQ,YAAY,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/E,YAAM,SAAS,eAAe,cAAc,CAAC,CAAC;AAC9C;AAAA;AAAA,QAEE,CAAC,oBAAoB,KAAK,SAAS,YACjC,CAAC;AAAA,UACC,OAAO;AAAA,UACP,KAAK;AAAA,UACL,QAAQ;AAAA,UACR,WAAW;AAAA,UACX,OAAO,WAAW;AAAA,UAEjB,SACH,EARC,mBASH,EAVC;AAAA;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,CAAC,MAAM,KAAK;AACpB,aAAO,YAAY,MAAM,KAAK,KAAK,KAAK;AAAA,IAC1C;AACA,WAAO;AAAA,EACT,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/linear-gradient",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"lint:fix": "../../node_modules/.bin/rome check --apply-suggested src"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tamagui/core": "^1.1.
|
|
27
|
-
"@tamagui/stacks": "^1.1.
|
|
26
|
+
"@tamagui/core": "^1.1.9",
|
|
27
|
+
"@tamagui/stacks": "^1.1.9"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "*",
|
|
31
31
|
"react-dom": "*"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tamagui/build": "^1.1.
|
|
34
|
+
"@tamagui/build": "^1.1.9",
|
|
35
35
|
"expo-linear-gradient": "^12.0.1",
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"react-dom": "^18.2.0"
|