@bifrostui/icons 2.0.0-alpha.2 → 2.0.0-alpha.21
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/SvgIcon.types.d.ts +1 -1
- package/dist/components/SvgIcon/SvgIcon.d.ts +1 -1
- package/dist/components/SvgIcon/SvgIcon.js +5 -5
- package/dist/utils/createSvgIcon.d.ts +1 -1
- package/dist/utils/createSvgIcon.js +3 -3
- package/es/SvgIcon.types.d.ts +1 -1
- package/es/components/SvgIcon/SvgIcon.d.ts +1 -1
- package/es/components/SvgIcon/SvgIcon.js +1 -1
- package/es/utils/createSvgIcon.d.ts +1 -1
- package/es/utils/createSvgIcon.js +1 -1
- package/package.json +5 -4
package/dist/SvgIcon.types.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ __export(SvgIcon_exports, {
|
|
|
60
60
|
});
|
|
61
61
|
module.exports = __toCommonJS(SvgIcon_exports);
|
|
62
62
|
var import_clsx = __toESM(require("clsx"));
|
|
63
|
-
var
|
|
63
|
+
var React = __toESM(require("react"));
|
|
64
64
|
var import_utils = require("@bifrostui/utils");
|
|
65
65
|
var import_SvgIcon2 = require("./SvgIcon.css");
|
|
66
66
|
const classes = {
|
|
@@ -105,7 +105,7 @@ function SvgIcon(props, ref) {
|
|
|
105
105
|
}
|
|
106
106
|
if (Component === "svg") {
|
|
107
107
|
if (typeof children === "string") {
|
|
108
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ React.createElement(
|
|
109
109
|
Component,
|
|
110
110
|
__spreadValues({
|
|
111
111
|
ref,
|
|
@@ -122,7 +122,7 @@ function SvgIcon(props, ref) {
|
|
|
122
122
|
}, rest)
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ React.createElement(
|
|
126
126
|
Component,
|
|
127
127
|
__spreadValues({
|
|
128
128
|
ref,
|
|
@@ -141,7 +141,7 @@ function SvgIcon(props, ref) {
|
|
|
141
141
|
const parsedSvgColor = (0, import_utils.cssVarToValue)({
|
|
142
142
|
cssVar: svgColor
|
|
143
143
|
}) || svgColor;
|
|
144
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ React.createElement(
|
|
145
145
|
Component,
|
|
146
146
|
__spreadValues({
|
|
147
147
|
ref,
|
|
@@ -158,4 +158,4 @@ function SvgIcon(props, ref) {
|
|
|
158
158
|
}
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
|
-
var SvgIcon_default = /* @__PURE__ */
|
|
161
|
+
var SvgIcon_default = /* @__PURE__ */ React.forwardRef(SvgIcon);
|
|
@@ -45,10 +45,10 @@ __export(createSvgIcon_exports, {
|
|
|
45
45
|
});
|
|
46
46
|
module.exports = __toCommonJS(createSvgIcon_exports);
|
|
47
47
|
var import_utils = require("@bifrostui/utils");
|
|
48
|
-
var
|
|
48
|
+
var React = __toESM(require("react"));
|
|
49
49
|
var import_SvgIcon = __toESM(require("../components/SvgIcon"));
|
|
50
50
|
function createSvgIcon(path, displayName) {
|
|
51
|
-
const Component = (props, ref) => /* @__PURE__ */
|
|
51
|
+
const Component = (props, ref) => /* @__PURE__ */ React.createElement(import_SvgIcon.default, __spreadValues({ ref, component: import_utils.isMini ? "div" : "svg" }, props), path);
|
|
52
52
|
Component.displayName = `${displayName}Icon`;
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(Component));
|
|
54
54
|
}
|
package/es/SvgIcon.types.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
import { isMini } from "@bifrostui/utils";
|
|
18
|
-
import React from "react";
|
|
18
|
+
import * as React from "react";
|
|
19
19
|
import SvgIcon from "../components/SvgIcon";
|
|
20
20
|
function createSvgIcon(path, displayName) {
|
|
21
21
|
const Component = (props, ref) => /* @__PURE__ */ React.createElement(SvgIcon, __spreadValues({ ref, component: isMini ? "div" : "svg" }, props), path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bifrostui/icons",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.21",
|
|
4
4
|
"description": "SVG icon components for BUI",
|
|
5
5
|
"homepage": "http://bui.taopiaopiao.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,14 +33,15 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"clsx": "^2.1.1",
|
|
36
|
-
"@bifrostui/
|
|
37
|
-
"@bifrostui/
|
|
36
|
+
"@bifrostui/utils": "2.0.0-alpha.21",
|
|
37
|
+
"@bifrostui/types": "2.0.0-alpha.21"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "^17.0.0 || ^18.0.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "node esbuild.config.js",
|
|
44
|
-
"create:icon": "node ./builder.js --output-dir ./src/components --svg-dir ./src/svgs"
|
|
44
|
+
"create:icon": "node ./builder.js --output-dir ./src/components --svg-dir ./src/svgs",
|
|
45
|
+
"test": "cd ../.. && vitest run --project bui-icons"
|
|
45
46
|
}
|
|
46
47
|
}
|