@lobehub/icons-rn 1.4.1 → 1.4.2
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/README.md +16 -37
- package/dist/esm/index.js +169 -180
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +9 -20
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
|
+
var expoLinearGradient = require('expo-linear-gradient');
|
|
4
5
|
var reactNative = require('react-native');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var reactNativeSvg = require('react-native-svg');
|
|
@@ -25,12 +26,6 @@ var __spreadValues = (a, b) => {
|
|
|
25
26
|
return a;
|
|
26
27
|
};
|
|
27
28
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
29
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
30
|
-
}) : x)(function(x) {
|
|
31
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
32
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
33
|
-
});
|
|
34
29
|
var __objRest = (source, exclude) => {
|
|
35
30
|
var target = {};
|
|
36
31
|
for (var prop in source)
|
|
@@ -80,12 +75,14 @@ var parseLinearGradient = (gradientString) => {
|
|
|
80
75
|
const parts = match[1].split(",").map((s) => s.trim());
|
|
81
76
|
if (parts.length < 2) return null;
|
|
82
77
|
let direction = parts[0];
|
|
83
|
-
let colors
|
|
78
|
+
let colors;
|
|
84
79
|
let locations;
|
|
85
80
|
const isColor = direction.match(/#[\dA-Fa-f]{6}|#[\dA-Fa-f]{3}|rgb|hsl/);
|
|
86
81
|
const colorParts = isColor ? parts : parts.slice(1);
|
|
87
82
|
const colorData = colorParts.map((part) => {
|
|
88
|
-
const colorMatch = part.match(
|
|
83
|
+
const colorMatch = part.match(
|
|
84
|
+
/(#[\dA-Fa-f]{6}|#[\dA-Fa-f]{3}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\))/
|
|
85
|
+
);
|
|
89
86
|
const percentMatch = part.match(/(\d+(?:\.\d+)?)%/);
|
|
90
87
|
if (colorMatch) {
|
|
91
88
|
return {
|
|
@@ -102,10 +99,7 @@ var parseLinearGradient = (gradientString) => {
|
|
|
102
99
|
return item.location !== void 0 ? item.location : index / (colorData.length - 1);
|
|
103
100
|
});
|
|
104
101
|
}
|
|
105
|
-
const coordinates = isColor ? { end: { x: 0, y: 1 }, start: { x: 0, y: 0 } } : (
|
|
106
|
-
// default to bottom
|
|
107
|
-
parseGradientDirection(direction)
|
|
108
|
-
);
|
|
102
|
+
const coordinates = isColor ? { end: { x: 0, y: 1 }, start: { x: 0, y: 0 } } : parseGradientDirection(direction);
|
|
109
103
|
return __spreadProps(__spreadValues({
|
|
110
104
|
colors
|
|
111
105
|
}, coordinates), {
|
|
@@ -160,18 +154,13 @@ var RNIconAvatar = react.memo(
|
|
|
160
154
|
width: size
|
|
161
155
|
};
|
|
162
156
|
const combinedStyle = [containerStyle, style];
|
|
163
|
-
|
|
164
|
-
try {
|
|
165
|
-
LinearGradient55 = __require("react-native-linear-gradient").default;
|
|
166
|
-
} catch (e) {
|
|
167
|
-
}
|
|
168
|
-
if (gradientInfo && LinearGradient55) {
|
|
157
|
+
if (gradientInfo && expoLinearGradient.LinearGradient && gradientInfo.colors.length >= 2) {
|
|
169
158
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
170
|
-
|
|
159
|
+
expoLinearGradient.LinearGradient,
|
|
171
160
|
__spreadProps(__spreadValues({
|
|
172
161
|
colors: gradientInfo.colors,
|
|
173
162
|
end: gradientInfo.end,
|
|
174
|
-
locations: gradientInfo.locations,
|
|
163
|
+
locations: gradientInfo.locations && gradientInfo.locations.length >= 2 ? gradientInfo.locations : void 0,
|
|
175
164
|
start: gradientInfo.start,
|
|
176
165
|
style: combinedStyle
|
|
177
166
|
}, rest), {
|