@tamagui/helpers-tamagui 2.0.0-rc.9 → 2.1.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/getIcon.cjs +35 -27
- package/dist/cjs/getIcon.native.js +33 -27
- package/dist/cjs/getIcon.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/prevent.cjs +12 -10
- package/dist/cjs/prevent.native.js +12 -10
- package/dist/cjs/prevent.native.js.map +1 -1
- package/dist/cjs/useCurrentColor.cjs +14 -11
- package/dist/cjs/useCurrentColor.native.js +19 -18
- package/dist/cjs/useCurrentColor.native.js.map +1 -1
- package/dist/cjs/useGetThemedIcon.cjs +38 -30
- package/dist/cjs/useGetThemedIcon.native.js +36 -30
- package/dist/cjs/useGetThemedIcon.native.js.map +1 -1
- package/dist/esm/getIcon.mjs +11 -5
- package/dist/esm/getIcon.mjs.map +1 -1
- package/dist/esm/getIcon.native.js +9 -5
- package/dist/esm/getIcon.native.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/useCurrentColor.mjs +2 -1
- package/dist/esm/useCurrentColor.mjs.map +1 -1
- package/dist/esm/useCurrentColor.native.js +3 -4
- package/dist/esm/useCurrentColor.native.js.map +1 -1
- package/dist/esm/useGetThemedIcon.mjs +12 -6
- package/dist/esm/useGetThemedIcon.mjs.map +1 -1
- package/dist/esm/useGetThemedIcon.native.js +10 -6
- package/dist/esm/useGetThemedIcon.native.js.map +1 -1
- package/package.json +8 -8
- package/src/getIcon.tsx +1 -0
- package/types/getIcon.d.ts +1 -0
- package/types/getIcon.d.ts.map +1 -1
- package/dist/cjs/getIcon.js +0 -34
- package/dist/cjs/getIcon.js.map +0 -6
- package/dist/cjs/index.js +0 -19
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/prevent.js +0 -21
- package/dist/cjs/prevent.js.map +0 -6
- package/dist/cjs/useCurrentColor.js +0 -25
- package/dist/cjs/useCurrentColor.js.map +0 -6
- package/dist/cjs/useGetIcon.cjs +0 -42
- package/dist/cjs/useGetIcon.js +0 -34
- package/dist/cjs/useGetIcon.js.map +0 -6
- package/dist/cjs/useGetIcon.native.js +0 -49
- package/dist/cjs/useGetIcon.native.js.map +0 -1
- package/dist/cjs/useGetThemedIcon.js +0 -38
- package/dist/cjs/useGetThemedIcon.js.map +0 -6
- package/dist/esm/getIcon.js +0 -10
- package/dist/esm/getIcon.js.map +0 -6
- package/dist/esm/prevent.js +0 -5
- package/dist/esm/prevent.js.map +0 -6
- package/dist/esm/useCurrentColor.js +0 -9
- package/dist/esm/useCurrentColor.js.map +0 -6
- package/dist/esm/useGetIcon.js +0 -10
- package/dist/esm/useGetIcon.js.map +0 -6
- package/dist/esm/useGetIcon.mjs +0 -8
- package/dist/esm/useGetIcon.mjs.map +0 -1
- package/dist/esm/useGetIcon.native.js +0 -12
- package/dist/esm/useGetIcon.native.js.map +0 -1
- package/dist/esm/useGetThemedIcon.js +0 -15
- package/dist/esm/useGetThemedIcon.js.map +0 -6
- package/types/useGetIcon.d.ts.map +0 -1
package/dist/cjs/getIcon.cjs
CHANGED
|
@@ -2,41 +2,49 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var getIcon_exports = {};
|
|
33
35
|
__export(getIcon_exports, {
|
|
34
36
|
getIcon: () => getIcon
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(getIcon_exports);
|
|
37
39
|
var import_react = __toESM(require("react"), 1);
|
|
38
|
-
const getIcon = (el, props) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const getIcon = (el, props) => {
|
|
41
|
+
if (!el) return el;
|
|
42
|
+
if (import_react.default.isValidElement(el)) {
|
|
43
|
+
return import_react.default.cloneElement(el, {
|
|
44
|
+
...props,
|
|
45
|
+
// @ts-expect-error
|
|
46
|
+
...el.props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return import_react.default.createElement(el, props);
|
|
50
|
+
};
|
|
@@ -4,44 +4,50 @@ var __create = Object.create;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
8
|
-
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
18
|
get: () => from[key],
|
|
18
19
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
22
24
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
34
36
|
var getIcon_exports = {};
|
|
35
37
|
__export(getIcon_exports, {
|
|
36
38
|
getIcon: () => getIcon
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(getIcon_exports);
|
|
39
|
-
var import_react = __toESM(require("react"), 1)
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
var import_react = __toESM(require("react"), 1);
|
|
42
|
+
var getIcon = function (el, props) {
|
|
43
|
+
if (!el) return el;
|
|
44
|
+
if (/* @__PURE__ */import_react.default.isValidElement(el)) {
|
|
45
|
+
return /* @__PURE__ */import_react.default.cloneElement(el, {
|
|
42
46
|
...props,
|
|
43
47
|
// @ts-expect-error
|
|
44
48
|
...el.props
|
|
45
|
-
})
|
|
46
|
-
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */import_react.default.createElement(el, props);
|
|
52
|
+
};
|
|
47
53
|
//# sourceMappingURL=getIcon.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","getIcon_exports","__export","getIcon","module","exports","import_react","__toESM","require","el","props","default","isValidElement","cloneElement"],"sources":["../../src/getIcon.tsx"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","getIcon_exports","__export","getIcon","module","exports","import_react","__toESM","require","el","props","default","isValidElement","cloneElement","createElement"],"sources":["../../src/getIcon.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkB,CAAAK,eAAA;AAEX,IAAAK,YAAgB,GACrBC,OACA,CAAAC,OAKG;AACH,IAAAL,OAAS,YAAAA,CAAOM,EAAA,EAAAC,KAAA;EAChB,IAAI,CAAAD,EAAA,SAAAA,EAAA;EACF,mBAAOH,YAAM,CAAAK,OAAA,CAAAC,cAAiB,CAAAH,EAAA;IAAA,OACzB,eAAAH,YAAA,CAAAK,OAAA,CAAAE,YAAA,CAAAJ,EAAA;MAAA,GAAAC,KAAA;MAEH;MACD,GAAAD,EAAA,CAAAC;IACH;EACA;EACF,sBAAAJ,YAAA,CAAAK,OAAA,CAAAG,aAAA,CAAAL,EAAA,EAAAC,KAAA","ignoreList":[]}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,15 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
7
8
|
get: () => from[key],
|
|
8
9
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
15
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
-
value:
|
|
16
|
+
value: true
|
|
15
17
|
}), mod);
|
|
16
18
|
var index_exports = {};
|
|
17
19
|
module.exports = __toCommonJS(index_exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
10
|
get: () => from[key],
|
|
10
11
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
12
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
17
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value:
|
|
18
|
+
value: true
|
|
17
19
|
}), mod);
|
|
18
20
|
var index_exports = {};
|
|
19
21
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,mBADd,GAAAH,MAAA,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,yBAAAH,MAAA,CAAAC,OAFd;AAGAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,iCAAAH,MAHd,CAAAC,OAAA;AAIAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,+BAJd,GAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
|
package/dist/cjs/prevent.cjs
CHANGED
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var prevent_exports = {};
|
|
22
24
|
__export(prevent_exports, {
|
|
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var prevent_exports = {};
|
|
24
26
|
__export(prevent_exports, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","prevent_exports","__export","prevent","module","exports"],"sources":["../../src/prevent.tsx"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","prevent_exports","__export","prevent","module","exports"],"sources":["../../src/prevent.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAA;AAAA;AAAOC,MAAM,CAAAC,OAAA,GAAWT,YAAS,CAAAK,eAAkB,CAAE","ignoreList":[]}
|
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var useCurrentColor_exports = {};
|
|
22
24
|
__export(useCurrentColor_exports, {
|
|
@@ -26,5 +28,6 @@ module.exports = __toCommonJS(useCurrentColor_exports);
|
|
|
26
28
|
var import_web = require("@tamagui/web");
|
|
27
29
|
const useCurrentColor = colorProp => {
|
|
28
30
|
const theme = (0, import_web.useTheme)();
|
|
29
|
-
|
|
31
|
+
const out = colorProp ? (0, import_web.getVariable)(colorProp) : theme[colorProp]?.get() || theme.color?.get();
|
|
32
|
+
return out;
|
|
30
33
|
};
|
|
@@ -5,32 +5,33 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var useCurrentColor_exports = {};
|
|
24
26
|
__export(useCurrentColor_exports, {
|
|
25
27
|
useCurrentColor: () => useCurrentColor
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(useCurrentColor_exports);
|
|
28
|
-
var import_web = require("@tamagui/web")
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
30
|
+
var import_web = require("@tamagui/web");
|
|
31
|
+
var useCurrentColor = function (colorProp) {
|
|
32
|
+
var _theme_colorProp, _theme_color;
|
|
33
|
+
var theme = (0, import_web.useTheme)();
|
|
34
|
+
var out = colorProp ? (0, import_web.getVariable)(colorProp) : ((_theme_colorProp = theme[colorProp]) === null || _theme_colorProp === void 0 ? void 0 : _theme_colorProp.get()) || ((_theme_color = theme.color) === null || _theme_color === void 0 ? void 0 : _theme_color.get());
|
|
35
|
+
return out;
|
|
36
|
+
};
|
|
36
37
|
//# sourceMappingURL=useCurrentColor.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useCurrentColor_exports","__export","useCurrentColor","module","exports","import_web","require","colorProp","_theme_colorProp","_theme_color","theme","useTheme","out","getVariable","get","color"],"sources":["../../src/useCurrentColor.tsx"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useCurrentColor_exports","__export","useCurrentColor","module","exports","import_web","require","colorProp","_theme_colorProp","_theme_color","theme","useTheme","out","getVariable","get","color"],"sources":["../../src/useCurrentColor.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAsCT,YAAA,CAAAK,uBAAA;AAG/B,IAAAK,UAAM,GAAAC,OAAkB,CAAC,cAAyB;AACvD,IAAAJ,eAAM,GAAQ,SAAAA,CAAAK,SAAA,EAAS;EACvB,IAAAC,gBAAY,EAAAC,YACR;EAEJ,IAAAC,KAAO,OAAAL,UAAA,CAAAM,QAAA;EACT,IAAAC,GAAA,GAAAL,SAAA,OAAAF,UAAA,CAAAQ,WAAA,EAAAN,SAAA,MAAAC,gBAAA,GAAAE,KAAA,CAAAH,SAAA,eAAAC,gBAAA,uBAAAA,gBAAA,CAAAM,GAAA,SAAAL,YAAA,GAAAC,KAAA,CAAAK,KAAA,cAAAN,YAAA,uBAAAA,YAAA,CAAAK,GAAA","ignoreList":[]}
|
|
@@ -2,46 +2,54 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var useGetThemedIcon_exports = {};
|
|
33
35
|
__export(useGetThemedIcon_exports, {
|
|
34
36
|
useGetThemedIcon: () => useGetThemedIcon
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(useGetThemedIcon_exports);
|
|
37
|
-
var import_react = __toESM(require("react"), 1)
|
|
38
|
-
|
|
39
|
+
var import_react = __toESM(require("react"), 1);
|
|
40
|
+
var import_useCurrentColor = require("./useCurrentColor.cjs");
|
|
39
41
|
const useGetThemedIcon = props => {
|
|
40
42
|
const color = (0, import_useCurrentColor.useCurrentColor)(props.color);
|
|
41
|
-
return el =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
return el => {
|
|
44
|
+
if (!el) return el;
|
|
45
|
+
if (import_react.default.isValidElement(el)) {
|
|
46
|
+
return import_react.default.cloneElement(el, {
|
|
47
|
+
...props,
|
|
48
|
+
color,
|
|
49
|
+
// @ts-expect-error
|
|
50
|
+
...el.props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return import_react.default.createElement(el, props);
|
|
54
|
+
};
|
|
47
55
|
};
|
|
@@ -4,49 +4,55 @@ var __create = Object.create;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
8
|
-
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
18
|
get: () => from[key],
|
|
18
19
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
22
24
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
34
36
|
var useGetThemedIcon_exports = {};
|
|
35
37
|
__export(useGetThemedIcon_exports, {
|
|
36
38
|
useGetThemedIcon: () => useGetThemedIcon
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(useGetThemedIcon_exports);
|
|
39
|
-
var import_react = __toESM(require("react"), 1)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
var import_react = __toESM(require("react"), 1);
|
|
42
|
+
var import_useCurrentColor = require("./useCurrentColor.native.js");
|
|
43
|
+
var useGetThemedIcon = function (props) {
|
|
44
|
+
var color = (0, import_useCurrentColor.useCurrentColor)(props.color);
|
|
45
|
+
return function (el) {
|
|
46
|
+
if (!el) return el;
|
|
47
|
+
if (/* @__PURE__ */import_react.default.isValidElement(el)) {
|
|
48
|
+
return /* @__PURE__ */import_react.default.cloneElement(el, {
|
|
45
49
|
...props,
|
|
46
50
|
color,
|
|
47
51
|
// @ts-expect-error
|
|
48
52
|
...el.props
|
|
49
|
-
})
|
|
50
|
-
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */import_react.default.createElement(el, props);
|
|
51
56
|
};
|
|
57
|
+
};
|
|
52
58
|
//# sourceMappingURL=useGetThemedIcon.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useGetThemedIcon_exports","__export","useGetThemedIcon","module","exports","import_react","__toESM","require","import_useCurrentColor","props","color","useCurrentColor","el","default","isValidElement","cloneElement","createElement"],"sources":["../../src/useGetThemedIcon.tsx"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useGetThemedIcon_exports","__export","useGetThemedIcon","module","exports","import_react","__toESM","require","import_useCurrentColor","props","color","useCurrentColor","el","default","isValidElement","cloneElement","createElement"],"sources":["../../src/useGetThemedIcon.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkB,CAAAK,wBAAA;AAElB,IAAAK,YAAA,GAAAC,OAAA,CAAAC,OAAgC;AAEzB,IAAAC,sBAA0B,GAAAD,OAA8C;AAC7E,IAAAL,gBAAc,YAAAA,CAAAO,KAAA;EACd,IAAAC,KAAQ,OAAYF,sBAAA,CAAAG,eAAA,EAAAF,KAAA,CAAAC,KAAA;EAClB,OAAK,UAAIE,EAAO;IAChB,IAAI,CAAAA,EAAA,SAAAA,EAAA;IACF,mBAAOP,YAAM,CAAAQ,OAAA,CAAAC,cAAiB,CAAAF,EAAA;MAAA,OACzB,eAAAP,YAAA,CAAAQ,OAAA,CAAAE,YAAA,CAAAH,EAAA;QACH,GAAAH,KAAA;QAAAC,KAAA;QAEA;QACD,GAAAE,EAAA,CAAAH;MACH;IACA;IACF,sBAAAJ,YAAA,CAAAQ,OAAA,CAAAG,aAAA,CAAAJ,EAAA,EAAAH,KAAA;EACF","ignoreList":[]}
|
package/dist/esm/getIcon.mjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
const getIcon = (el, props) =>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
const getIcon = (el, props) => {
|
|
3
|
+
if (!el) return el;
|
|
4
|
+
if (React.isValidElement(el)) {
|
|
5
|
+
return React.cloneElement(el, {
|
|
6
|
+
...props,
|
|
7
|
+
// @ts-expect-error
|
|
8
|
+
...el.props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return React.createElement(el, props);
|
|
12
|
+
};
|
|
7
13
|
export { getIcon };
|
|
8
14
|
//# sourceMappingURL=getIcon.mjs.map
|
package/dist/esm/getIcon.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getIcon","el","props","isValidElement","cloneElement","createElement"],"sources":["../../src/getIcon.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,MAAMC,OAAA,GAAUA,CACrBC,EAAA,EACAC,KAAA,
|
|
1
|
+
{"version":3,"names":["React","getIcon","el","props","isValidElement","cloneElement","createElement"],"sources":["../../src/getIcon.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,MAAMC,OAAA,GAAUA,CACrBC,EAAA,EACAC,KAAA,KAKG;EACH,IAAI,CAACD,EAAA,EAAI,OAAOA,EAAA;EAChB,IAAIF,KAAA,CAAMI,cAAA,CAAeF,EAAE,GAAG;IAC5B,OAAOF,KAAA,CAAMK,YAAA,CAAaH,EAAA,EAAI;MAC5B,GAAGC,KAAA;MAAA;MAEH,GAAGD,EAAA,CAAGC;IACR,CAAC;EACH;EACA,OAAOH,KAAA,CAAMM,aAAA,CAAcJ,EAAA,EAAIC,KAAK;AACtC","ignoreList":[]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
var getIcon = function (el, props) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
if (!el) return el;
|
|
4
|
+
if (/* @__PURE__ */React.isValidElement(el)) {
|
|
5
|
+
return /* @__PURE__ */React.cloneElement(el, {
|
|
6
|
+
...props,
|
|
7
|
+
// @ts-expect-error
|
|
8
|
+
...el.props
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */React.createElement(el, props);
|
|
8
12
|
};
|
|
9
13
|
export { getIcon };
|
|
10
14
|
//# sourceMappingURL=getIcon.native.js.map
|