@tamagui/linear-gradient 1.5.8 → 1.5.10
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.js +13 -15
- package/dist/cjs/LinearGradient.shared.js.map +2 -2
- package/dist/esm/LinearGradient.shared.js +14 -15
- package/dist/esm/LinearGradient.shared.js.map +2 -2
- package/dist/esm/LinearGradient.shared.mjs +14 -15
- package/dist/esm/LinearGradient.shared.mjs.map +2 -2
- package/dist/jsx/LinearGradient.shared.js +10 -11
- package/dist/jsx/LinearGradient.shared.js.map +2 -2
- package/dist/jsx/LinearGradient.shared.mjs +10 -11
- package/dist/jsx/LinearGradient.shared.mjs.map +2 -2
- package/package.json +4 -4
- package/src/LinearGradient.shared.tsx +4 -3
- package/types/LinearGradient.shared.d.ts.map +1 -1
|
@@ -38,23 +38,21 @@ var React = __toESM(require("react"));
|
|
|
38
38
|
var import_linear_gradient = require("./linear-gradient");
|
|
39
39
|
const LinearGradient = import_stacks.YStack.extractable(
|
|
40
40
|
(0, import_core.themeable)(
|
|
41
|
-
React.forwardRef((
|
|
41
|
+
React.forwardRef((propsIn, ref) => {
|
|
42
|
+
const props = (0, import_core.useMediaPropsActive)(propsIn);
|
|
42
43
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
43
44
|
const colors = useThemeColors(colorsProp || []);
|
|
44
|
-
return (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
) })
|
|
57
|
-
);
|
|
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
|
+
) });
|
|
58
56
|
})
|
|
59
57
|
)
|
|
60
58
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 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((
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
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;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
6
|
"names": ["ExpoLinearGradient"]
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
getVariable,
|
|
4
4
|
styled,
|
|
5
5
|
themeable,
|
|
6
|
+
useMediaPropsActive,
|
|
6
7
|
useTheme
|
|
7
8
|
} from "@tamagui/core";
|
|
8
9
|
import { YStack } from "@tamagui/stacks";
|
|
@@ -12,23 +13,21 @@ import {
|
|
|
12
13
|
} from "./linear-gradient";
|
|
13
14
|
const LinearGradient = YStack.extractable(
|
|
14
15
|
themeable(
|
|
15
|
-
React.forwardRef((
|
|
16
|
+
React.forwardRef((propsIn, ref) => {
|
|
17
|
+
const props = useMediaPropsActive(propsIn);
|
|
16
18
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
17
19
|
const colors = useThemeColors(colorsProp || []);
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
) })
|
|
31
|
-
);
|
|
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
|
+
) });
|
|
32
31
|
})
|
|
33
32
|
)
|
|
34
33
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 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((
|
|
5
|
-
"mappings": "
|
|
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;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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
getVariable,
|
|
4
4
|
styled,
|
|
5
5
|
themeable,
|
|
6
|
+
useMediaPropsActive,
|
|
6
7
|
useTheme
|
|
7
8
|
} from "@tamagui/core";
|
|
8
9
|
import { YStack } from "@tamagui/stacks";
|
|
@@ -12,23 +13,21 @@ import {
|
|
|
12
13
|
} from "./linear-gradient";
|
|
13
14
|
const LinearGradient = YStack.extractable(
|
|
14
15
|
themeable(
|
|
15
|
-
React.forwardRef((
|
|
16
|
+
React.forwardRef((propsIn, ref) => {
|
|
17
|
+
const props = useMediaPropsActive(propsIn);
|
|
16
18
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
17
19
|
const colors = useThemeColors(colorsProp || []);
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
) })
|
|
31
|
-
);
|
|
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
|
+
) });
|
|
32
31
|
})
|
|
33
32
|
)
|
|
34
33
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 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((
|
|
5
|
-
"mappings": "
|
|
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;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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
getVariable,
|
|
3
3
|
styled,
|
|
4
4
|
themeable,
|
|
5
|
+
useMediaPropsActive,
|
|
5
6
|
useTheme
|
|
6
7
|
} from "@tamagui/core";
|
|
7
8
|
import { YStack } from "@tamagui/stacks";
|
|
@@ -11,19 +12,17 @@ import {
|
|
|
11
12
|
} from "./linear-gradient";
|
|
12
13
|
const LinearGradient = YStack.extractable(
|
|
13
14
|
themeable(
|
|
14
|
-
React.forwardRef((
|
|
15
|
+
React.forwardRef((propsIn, ref) => {
|
|
16
|
+
const props = useMediaPropsActive(propsIn);
|
|
15
17
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
16
18
|
const colors = useThemeColors(colorsProp || []);
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
style={absoluteFill}
|
|
25
|
-
>{children}</ExpoLinearGradient></LinearGradientFrame>
|
|
26
|
-
);
|
|
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>;
|
|
27
26
|
})
|
|
28
27
|
)
|
|
29
28
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 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((
|
|
5
|
-
"mappings": "AAAA;AAAA,EAGE;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,
|
|
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;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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
getVariable,
|
|
3
3
|
styled,
|
|
4
4
|
themeable,
|
|
5
|
+
useMediaPropsActive,
|
|
5
6
|
useTheme
|
|
6
7
|
} from "@tamagui/core";
|
|
7
8
|
import { YStack } from "@tamagui/stacks";
|
|
@@ -11,19 +12,17 @@ import {
|
|
|
11
12
|
} from "./linear-gradient";
|
|
12
13
|
const LinearGradient = YStack.extractable(
|
|
13
14
|
themeable(
|
|
14
|
-
React.forwardRef((
|
|
15
|
+
React.forwardRef((propsIn, ref) => {
|
|
16
|
+
const props = useMediaPropsActive(propsIn);
|
|
15
17
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props;
|
|
16
18
|
const colors = useThemeColors(colorsProp || []);
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
style={absoluteFill}
|
|
25
|
-
>{children}</ExpoLinearGradient></LinearGradientFrame>
|
|
26
|
-
);
|
|
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>;
|
|
27
26
|
})
|
|
28
27
|
)
|
|
29
28
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 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((
|
|
5
|
-
"mappings": "AAAA;AAAA,EAGE;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,
|
|
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;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
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/linear-gradient",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.10",
|
|
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.5.
|
|
27
|
-
"@tamagui/stacks": "^1.5.
|
|
26
|
+
"@tamagui/core": "^1.5.10",
|
|
27
|
+
"@tamagui/stacks": "^1.5.10"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "*",
|
|
31
31
|
"react-dom": "*"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tamagui/build": "^1.5.
|
|
34
|
+
"@tamagui/build": "^1.5.10",
|
|
35
35
|
"expo-linear-gradient": "^12.0.1",
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"react-dom": "^18.2.0"
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
getVariable,
|
|
5
5
|
styled,
|
|
6
6
|
themeable,
|
|
7
|
+
useMediaPropsActive,
|
|
7
8
|
useTheme,
|
|
8
9
|
} from '@tamagui/core'
|
|
9
10
|
import { YStack, YStackProps } from '@tamagui/stacks'
|
|
@@ -25,12 +26,12 @@ export const LinearGradient: React.ForwardRefExoticComponent<
|
|
|
25
26
|
LinearGradientProps & React.RefAttributes<HTMLElement | View>
|
|
26
27
|
> = YStack.extractable(
|
|
27
28
|
themeable(
|
|
28
|
-
React.forwardRef((
|
|
29
|
+
React.forwardRef((propsIn: LinearGradientProps, ref) => {
|
|
30
|
+
const props = useMediaPropsActive(propsIn)
|
|
29
31
|
const { start, end, colors: colorsProp, locations, children, ...stackProps } = props
|
|
30
32
|
const colors = useThemeColors(colorsProp || [])
|
|
31
33
|
return (
|
|
32
|
-
|
|
33
|
-
<LinearGradientFrame ref={ref} {...stackProps}>
|
|
34
|
+
<LinearGradientFrame ref={ref as any} {...stackProps}>
|
|
34
35
|
<ExpoLinearGradient
|
|
35
36
|
start={start}
|
|
36
37
|
end={end}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearGradient.shared.d.ts","sourceRoot":"","sources":["../src/LinearGradient.shared.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,
|
|
1
|
+
{"version":3,"file":"LinearGradient.shared.d.ts","sourceRoot":"","sources":["../src/LinearGradient.shared.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,EAMZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAU,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAEnD,OAAO,EAEL,mBAAmB,IAAI,uBAAuB,EAC/C,MAAM,mBAAmB,CAAA;AAG1B,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GACvE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,MAAM,uBAAuB,CAAC,GAAG;IAC9D,MAAM,CAAC,EAAE,CAAC,WAAW,GAAG,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,CAAA;CACvD,CAAA;AAEH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAC1D,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAC,CAsBvD,CAAA"}
|