@tamagui/linear-gradient 1.2.9 → 1.2.11

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.
@@ -0,0 +1,2 @@
1
+ export * from "./LinearGradient.shared";
2
+ //# sourceMappingURL=LinearGradient.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/LinearGradient.tsx"],
4
+ "sourcesContent": ["export * from './LinearGradient.shared'\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
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
+ };
9
+ //# sourceMappingURL=LinearGradient.native.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/LinearGradient.native.tsx"],
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,QAAM,GAAG,OAAO;AAC1B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,53 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ getVariable,
4
+ styled,
5
+ themeable,
6
+ useTheme
7
+ } from "@tamagui/core";
8
+ import { YStack } from "@tamagui/stacks";
9
+ import * as React from "react";
10
+ import { StyleSheet } from "react-native";
11
+ import {
12
+ LinearGradient as ExpoLinearGradient
13
+ } from "./linear-gradient";
14
+ const LinearGradient = YStack.extractable(
15
+ themeable(
16
+ React.forwardRef((props, ref) => {
17
+ const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
18
+ const colors = useThemeColors(colorsProp || []);
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
+ );
33
+ })
34
+ )
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
+ };
53
+ //# sourceMappingURL=LinearGradient.shared.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/LinearGradient.shared.tsx"],
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,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
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./LinearGradient";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["export * from './LinearGradient'\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import { LinearGradient } from "expo-linear-gradient";
2
+ export {
3
+ LinearGradient
4
+ };
5
+ //# sourceMappingURL=linear-gradient.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/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,2 @@
1
+ export * from "./LinearGradient.shared";
2
+ //# sourceMappingURL=LinearGradient.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/LinearGradient.tsx"],
4
+ "sourcesContent": ["export * from './LinearGradient.shared'\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ function LinearGradient(props) {
2
+ const Real = require("./LinearGradient.shared").LinearGradient;
3
+ return <Real {...props} />;
4
+ }
5
+ export {
6
+ LinearGradient
7
+ };
8
+ //# sourceMappingURL=LinearGradient.native.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/LinearGradient.native.tsx"],
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": "AAOO,SAAS,eAAe,OAAO;AACpC,QAAM,OAAO,QAAQ,yBAAyB,EAAE;AAEhD,SAAO,CAAC,SAAS,OAAO;AAC1B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,48 @@
1
+ import {
2
+ getVariable,
3
+ styled,
4
+ themeable,
5
+ useTheme
6
+ } from "@tamagui/core";
7
+ import { YStack } from "@tamagui/stacks";
8
+ import * as React from "react";
9
+ import { StyleSheet } from "react-native";
10
+ import {
11
+ LinearGradient as ExpoLinearGradient
12
+ } from "./linear-gradient";
13
+ const LinearGradient = YStack.extractable(
14
+ themeable(
15
+ React.forwardRef((props, ref) => {
16
+ const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
17
+ const colors = useThemeColors(colorsProp || []);
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
+ );
28
+ })
29
+ )
30
+ );
31
+ const LinearGradientFrame = styled(YStack, {
32
+ name: "LinearGradient",
33
+ overflow: "hidden",
34
+ position: "relative"
35
+ });
36
+ const useThemeColors = (colors) => {
37
+ const theme = useTheme();
38
+ return colors.map((color) => {
39
+ if (color[0] === "$") {
40
+ return getVariable(theme[color] || color);
41
+ }
42
+ return color;
43
+ });
44
+ };
45
+ export {
46
+ LinearGradient
47
+ };
48
+ //# sourceMappingURL=LinearGradient.shared.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/LinearGradient.shared.tsx"],
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,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
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./LinearGradient";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["export * from './LinearGradient'\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ import { LinearGradient } from "expo-linear-gradient";
2
+ export {
3
+ LinearGradient
4
+ };
5
+ //# sourceMappingURL=linear-gradient.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/linear-gradient",
3
- "version": "1.2.9",
3
+ "version": "1.2.11",
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.2.9",
27
- "@tamagui/stacks": "^1.2.9"
26
+ "@tamagui/core": "^1.2.11",
27
+ "@tamagui/stacks": "^1.2.11"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": "*",
31
31
  "react-dom": "*"
32
32
  },
33
33
  "devDependencies": {
34
- "@tamagui/build": "^1.2.9",
34
+ "@tamagui/build": "^1.2.11",
35
35
  "expo-linear-gradient": "^12.0.1",
36
36
  "react": "^18.2.0",
37
37
  "react-dom": "^18.2.0"