@bifrostui/icons 2.0.0-alpha.32 → 2.0.0-alpha.33

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.
@@ -59,6 +59,7 @@ __export(SvgIcon_exports, {
59
59
  default: () => SvgIcon_default
60
60
  });
61
61
  module.exports = __toCommonJS(SvgIcon_exports);
62
+ var import_jsx_runtime = require("react/jsx-runtime");
62
63
  var import_clsx = __toESM(require("clsx"));
63
64
  var React = __toESM(require("react"));
64
65
  var import_utils = require("@bifrostui/utils");
@@ -105,7 +106,7 @@ function SvgIcon(props, ref) {
105
106
  }
106
107
  if (Component === "svg") {
107
108
  if (typeof children === "string") {
108
- return /* @__PURE__ */ React.createElement(
109
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
109
110
  Component,
110
111
  __spreadValues({
111
112
  ref,
@@ -122,9 +123,9 @@ function SvgIcon(props, ref) {
122
123
  }, rest)
123
124
  );
124
125
  }
125
- return /* @__PURE__ */ React.createElement(
126
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
127
  Component,
127
- __spreadValues({
128
+ __spreadProps(__spreadValues({
128
129
  ref,
129
130
  className: (0, import_clsx.default)(classes.root, className, {
130
131
  [`icon-size-${size}`]: size
@@ -133,15 +134,16 @@ function SvgIcon(props, ref) {
133
134
  viewBox,
134
135
  color: svgColor || htmlColor,
135
136
  style
136
- }, rest),
137
- children
137
+ }, rest), {
138
+ children
139
+ })
138
140
  );
139
141
  }
140
142
  if (typeof children === "string") {
141
143
  const parsedSvgColor = (0, import_utils.cssVarToValue)({
142
144
  cssVar: svgColor
143
145
  }) || svgColor;
144
- return /* @__PURE__ */ React.createElement(
146
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
145
147
  Component,
146
148
  __spreadValues({
147
149
  ref,
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import './index.less';
3
- declare const IconDemo: () => React.JSX.Element;
2
+ declare const IconDemo: () => import("react/jsx-runtime").JSX.Element;
4
3
  export default IconDemo;
@@ -30,7 +30,8 @@ __export(demo_exports, {
30
30
  default: () => demo_default
31
31
  });
32
32
  module.exports = __toCommonJS(demo_exports);
33
- var import_react = __toESM(require("react"));
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var import_react = require("react");
34
35
  var import_react2 = require("@bifrostui/react");
35
36
  var iconComponents = __toESM(require("../components"));
36
37
  var import_index = require("./index.css");
@@ -88,53 +89,79 @@ const IconDemo = () => {
88
89
  })
89
90
  );
90
91
  }, [search]);
91
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "icon-container" }, /* @__PURE__ */ import_react.default.createElement(
92
- import_react2.RadioGroup,
93
- {
94
- value: theme,
95
- onChange: (_, data) => {
96
- setTheme(data.value);
97
- }
98
- },
99
- /* @__PURE__ */ import_react.default.createElement(import_react2.Radio, { value: "All" }, "All"),
100
- /* @__PURE__ */ import_react.default.createElement(import_react2.Radio, { value: "Filled" }, "Filled"),
101
- /* @__PURE__ */ import_react.default.createElement(import_react2.Radio, { value: "Outlined" }, "Outlined"),
102
- /* @__PURE__ */ import_react.default.createElement(import_react2.Radio, { value: "Others" }, "Others")
103
- ), /* @__PURE__ */ import_react.default.createElement("div", { className: "icon-panel" }, /* @__PURE__ */ import_react.default.createElement(
104
- import_react2.Input,
105
- {
106
- placeholder: "Search icons",
107
- value: search,
108
- onChange: (e) => {
109
- setSearch(e.target.value);
110
- }
111
- }
112
- ), search ? /* @__PURE__ */ import_react.default.createElement("div", { className: "icon-container-hint" }, icons.length, " matching results") : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "icon-container-content" }, icons.map((icon) => {
113
- return /* @__PURE__ */ import_react.default.createElement(
114
- "div",
92
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "icon-container", children: [
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
94
+ import_react2.RadioGroup,
115
95
  {
116
- className: "icon-item",
117
- key: icon.importName,
118
- title: icon.importName,
119
- onClick: () => {
120
- setCurrentIcon(icon);
121
- setOpen(true);
96
+ value: theme,
97
+ onChange: (_, data) => {
98
+ setTheme(data.value);
99
+ },
100
+ children: [
101
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Radio, { value: "All", children: "All" }),
102
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Radio, { value: "Filled", children: "Filled" }),
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Radio, { value: "Outlined", children: "Outlined" }),
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Radio, { value: "Others", children: "Others" })
105
+ ]
106
+ }
107
+ ),
108
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "icon-panel", children: [
109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
+ import_react2.Input,
111
+ {
112
+ placeholder: "Search icons",
113
+ value: search,
114
+ onChange: (e) => {
115
+ setSearch(e.target.value);
116
+ }
122
117
  }
123
- },
124
- /* @__PURE__ */ import_react.default.createElement(icon.Component, { size: "large" }),
125
- /* @__PURE__ */ import_react.default.createElement("div", { className: "icon-name" }, icon.importName)
126
- );
127
- }))), /* @__PURE__ */ import_react.default.createElement(
128
- import_react2.Modal,
129
- {
130
- className: "icon-container-modal",
131
- open,
132
- onClose: () => {
133
- setOpen(false);
134
- setCurrentIcon(null);
118
+ ),
119
+ search ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "icon-container-hint", children: [
120
+ icons.length,
121
+ " matching results"
122
+ ] }) : null,
123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "icon-container-content", children: icons.map((icon) => {
124
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
125
+ "div",
126
+ {
127
+ className: "icon-item",
128
+ title: icon.importName,
129
+ onClick: () => {
130
+ setCurrentIcon(icon);
131
+ setOpen(true);
132
+ },
133
+ children: [
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(icon.Component, { size: "large" }),
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "icon-name", children: icon.importName })
136
+ ]
137
+ },
138
+ icon.importName
139
+ );
140
+ }) })
141
+ ] }),
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ import_react2.Modal,
144
+ {
145
+ className: "icon-container-modal",
146
+ open,
147
+ onClose: () => {
148
+ setOpen(false);
149
+ setCurrentIcon(null);
150
+ },
151
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "modal-content", children: [
152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
153
+ " ",
154
+ currentIcon == null ? void 0 : currentIcon.importName
155
+ ] }),
156
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
157
+ "import ",
158
+ `{ ${currentIcon == null ? void 0 : currentIcon.importName} }`,
159
+ " from '@bifrostui/icons';"
160
+ ] }),
161
+ currentIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(currentIcon.Component, { style: { fontSize: "100px" } }) : null
162
+ ] })
135
163
  }
136
- },
137
- /* @__PURE__ */ import_react.default.createElement("div", { className: "modal-content" }, /* @__PURE__ */ import_react.default.createElement("div", null, " ", currentIcon == null ? void 0 : currentIcon.importName), /* @__PURE__ */ import_react.default.createElement("div", null, "import ", `{ ${currentIcon == null ? void 0 : currentIcon.importName} }`, " from '@bifrostui/icons';"), currentIcon ? /* @__PURE__ */ import_react.default.createElement(currentIcon.Component, { style: { fontSize: "100px" } }) : null)
138
- ));
164
+ )
165
+ ] });
139
166
  };
140
167
  var demo_default = IconDemo;
@@ -1,6 +1,8 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
8
  var __getProtoOf = Object.getPrototypeOf;
@@ -18,6 +20,7 @@ var __spreadValues = (a, b) => {
18
20
  }
19
21
  return a;
20
22
  };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
24
  var __export = (target, all) => {
22
25
  for (var name in all)
23
26
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -44,11 +47,12 @@ __export(createSvgIcon_exports, {
44
47
  default: () => createSvgIcon
45
48
  });
46
49
  module.exports = __toCommonJS(createSvgIcon_exports);
50
+ var import_jsx_runtime = require("react/jsx-runtime");
47
51
  var import_utils = require("@bifrostui/utils");
48
52
  var React = __toESM(require("react"));
49
53
  var import_SvgIcon = __toESM(require("../components/SvgIcon"));
50
54
  function createSvgIcon(path, displayName) {
51
- const Component = (props, ref) => /* @__PURE__ */ React.createElement(import_SvgIcon.default, __spreadValues({ ref, component: import_utils.isMini ? "div" : "svg" }, props), path);
55
+ const Component = (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SvgIcon.default, __spreadProps(__spreadValues({ ref, component: import_utils.isMini ? "div" : "svg" }, props), { children: path }));
52
56
  Component.displayName = `${displayName}Icon`;
53
57
  return /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(Component));
54
58
  }
@@ -29,6 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
+ import { jsx } from "react/jsx-runtime";
32
33
  import clsx from "clsx";
33
34
  import * as React from "react";
34
35
  import { cssVarToValue } from "@bifrostui/utils";
@@ -75,7 +76,7 @@ function SvgIcon(props, ref) {
75
76
  }
76
77
  if (Component === "svg") {
77
78
  if (typeof children === "string") {
78
- return /* @__PURE__ */ React.createElement(
79
+ return /* @__PURE__ */ jsx(
79
80
  Component,
80
81
  __spreadValues({
81
82
  ref,
@@ -92,9 +93,9 @@ function SvgIcon(props, ref) {
92
93
  }, rest)
93
94
  );
94
95
  }
95
- return /* @__PURE__ */ React.createElement(
96
+ return /* @__PURE__ */ jsx(
96
97
  Component,
97
- __spreadValues({
98
+ __spreadProps(__spreadValues({
98
99
  ref,
99
100
  className: clsx(classes.root, className, {
100
101
  [`icon-size-${size}`]: size
@@ -103,15 +104,16 @@ function SvgIcon(props, ref) {
103
104
  viewBox,
104
105
  color: svgColor || htmlColor,
105
106
  style
106
- }, rest),
107
- children
107
+ }, rest), {
108
+ children
109
+ })
108
110
  );
109
111
  }
110
112
  if (typeof children === "string") {
111
113
  const parsedSvgColor = cssVarToValue({
112
114
  cssVar: svgColor
113
115
  }) || svgColor;
114
- return /* @__PURE__ */ React.createElement(
116
+ return /* @__PURE__ */ jsx(
115
117
  Component,
116
118
  __spreadValues({
117
119
  ref,
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import './index.less';
3
- declare const IconDemo: () => React.JSX.Element;
2
+ declare const IconDemo: () => import("react/jsx-runtime").JSX.Element;
4
3
  export default IconDemo;
package/es/demo/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useState } from "react";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
2
3
  import { Input, Modal, Radio, RadioGroup } from "@bifrostui/react";
3
4
  import * as iconComponents from "../components";
4
5
  import "./index.css";
@@ -56,54 +57,80 @@ const IconDemo = () => {
56
57
  })
57
58
  );
58
59
  }, [search]);
59
- return /* @__PURE__ */ React.createElement("div", { className: "icon-container" }, /* @__PURE__ */ React.createElement(
60
- RadioGroup,
61
- {
62
- value: theme,
63
- onChange: (_, data) => {
64
- setTheme(data.value);
65
- }
66
- },
67
- /* @__PURE__ */ React.createElement(Radio, { value: "All" }, "All"),
68
- /* @__PURE__ */ React.createElement(Radio, { value: "Filled" }, "Filled"),
69
- /* @__PURE__ */ React.createElement(Radio, { value: "Outlined" }, "Outlined"),
70
- /* @__PURE__ */ React.createElement(Radio, { value: "Others" }, "Others")
71
- ), /* @__PURE__ */ React.createElement("div", { className: "icon-panel" }, /* @__PURE__ */ React.createElement(
72
- Input,
73
- {
74
- placeholder: "Search icons",
75
- value: search,
76
- onChange: (e) => {
77
- setSearch(e.target.value);
78
- }
79
- }
80
- ), search ? /* @__PURE__ */ React.createElement("div", { className: "icon-container-hint" }, icons.length, " matching results") : null, /* @__PURE__ */ React.createElement("div", { className: "icon-container-content" }, icons.map((icon) => {
81
- return /* @__PURE__ */ React.createElement(
82
- "div",
60
+ return /* @__PURE__ */ jsxs("div", { className: "icon-container", children: [
61
+ /* @__PURE__ */ jsxs(
62
+ RadioGroup,
83
63
  {
84
- className: "icon-item",
85
- key: icon.importName,
86
- title: icon.importName,
87
- onClick: () => {
88
- setCurrentIcon(icon);
89
- setOpen(true);
64
+ value: theme,
65
+ onChange: (_, data) => {
66
+ setTheme(data.value);
67
+ },
68
+ children: [
69
+ /* @__PURE__ */ jsx(Radio, { value: "All", children: "All" }),
70
+ /* @__PURE__ */ jsx(Radio, { value: "Filled", children: "Filled" }),
71
+ /* @__PURE__ */ jsx(Radio, { value: "Outlined", children: "Outlined" }),
72
+ /* @__PURE__ */ jsx(Radio, { value: "Others", children: "Others" })
73
+ ]
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsxs("div", { className: "icon-panel", children: [
77
+ /* @__PURE__ */ jsx(
78
+ Input,
79
+ {
80
+ placeholder: "Search icons",
81
+ value: search,
82
+ onChange: (e) => {
83
+ setSearch(e.target.value);
84
+ }
90
85
  }
91
- },
92
- /* @__PURE__ */ React.createElement(icon.Component, { size: "large" }),
93
- /* @__PURE__ */ React.createElement("div", { className: "icon-name" }, icon.importName)
94
- );
95
- }))), /* @__PURE__ */ React.createElement(
96
- Modal,
97
- {
98
- className: "icon-container-modal",
99
- open,
100
- onClose: () => {
101
- setOpen(false);
102
- setCurrentIcon(null);
86
+ ),
87
+ search ? /* @__PURE__ */ jsxs("div", { className: "icon-container-hint", children: [
88
+ icons.length,
89
+ " matching results"
90
+ ] }) : null,
91
+ /* @__PURE__ */ jsx("div", { className: "icon-container-content", children: icons.map((icon) => {
92
+ return /* @__PURE__ */ jsxs(
93
+ "div",
94
+ {
95
+ className: "icon-item",
96
+ title: icon.importName,
97
+ onClick: () => {
98
+ setCurrentIcon(icon);
99
+ setOpen(true);
100
+ },
101
+ children: [
102
+ /* @__PURE__ */ jsx(icon.Component, { size: "large" }),
103
+ /* @__PURE__ */ jsx("div", { className: "icon-name", children: icon.importName })
104
+ ]
105
+ },
106
+ icon.importName
107
+ );
108
+ }) })
109
+ ] }),
110
+ /* @__PURE__ */ jsx(
111
+ Modal,
112
+ {
113
+ className: "icon-container-modal",
114
+ open,
115
+ onClose: () => {
116
+ setOpen(false);
117
+ setCurrentIcon(null);
118
+ },
119
+ children: /* @__PURE__ */ jsxs("div", { className: "modal-content", children: [
120
+ /* @__PURE__ */ jsxs("div", { children: [
121
+ " ",
122
+ currentIcon == null ? void 0 : currentIcon.importName
123
+ ] }),
124
+ /* @__PURE__ */ jsxs("div", { children: [
125
+ "import ",
126
+ `{ ${currentIcon == null ? void 0 : currentIcon.importName} }`,
127
+ " from '@bifrostui/icons';"
128
+ ] }),
129
+ currentIcon ? /* @__PURE__ */ jsx(currentIcon.Component, { style: { fontSize: "100px" } }) : null
130
+ ] })
103
131
  }
104
- },
105
- /* @__PURE__ */ React.createElement("div", { className: "modal-content" }, /* @__PURE__ */ React.createElement("div", null, " ", currentIcon == null ? void 0 : currentIcon.importName), /* @__PURE__ */ React.createElement("div", null, "import ", `{ ${currentIcon == null ? void 0 : currentIcon.importName} }`, " from '@bifrostui/icons';"), currentIcon ? /* @__PURE__ */ React.createElement(currentIcon.Component, { style: { fontSize: "100px" } }) : null)
106
- ));
132
+ )
133
+ ] });
107
134
  };
108
135
  var demo_default = IconDemo;
109
136
  export {
@@ -1,4 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -14,11 +16,13 @@ var __spreadValues = (a, b) => {
14
16
  }
15
17
  return a;
16
18
  };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { jsx } from "react/jsx-runtime";
17
21
  import { isMini } from "@bifrostui/utils";
18
22
  import * as React from "react";
19
23
  import SvgIcon from "../components/SvgIcon";
20
24
  function createSvgIcon(path, displayName) {
21
- const Component = (props, ref) => /* @__PURE__ */ React.createElement(SvgIcon, __spreadValues({ ref, component: isMini ? "div" : "svg" }, props), path);
25
+ const Component = (props, ref) => /* @__PURE__ */ jsx(SvgIcon, __spreadProps(__spreadValues({ ref, component: isMini ? "div" : "svg" }, props), { children: path }));
22
26
  Component.displayName = `${displayName}Icon`;
23
27
  return /* @__PURE__ */ React.memo(/* @__PURE__ */ React.forwardRef(Component));
24
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifrostui/icons",
3
- "version": "2.0.0-alpha.32",
3
+ "version": "2.0.0-alpha.33",
4
4
  "description": "SVG icon components for BUI",
5
5
  "homepage": "http://bui.taopiaopiao.com",
6
6
  "license": "MIT",
@@ -24,20 +24,21 @@
24
24
  "devDependencies": {
25
25
  "chalk": "^4.1.2",
26
26
  "esbuild": "^0.19.7",
27
- "esbuild-plugin-less": "1.3.10",
27
+ "esbuild-plugin-less": "1.3.38",
28
28
  "fast-glob": "^3.3.1",
29
29
  "fs-extra": "^10.0.0",
30
30
  "glob": "11.0.0",
31
+ "react": "^19.0.0",
31
32
  "rimraf": "^3.0.0",
32
33
  "svgo": "^2.8.0"
33
34
  },
34
35
  "dependencies": {
35
36
  "clsx": "^2.1.1",
36
- "@bifrostui/types": "2.0.0-alpha.32",
37
- "@bifrostui/utils": "2.0.0-alpha.32"
37
+ "@bifrostui/types": "2.0.0-alpha.33",
38
+ "@bifrostui/utils": "2.0.0-alpha.33"
38
39
  },
39
40
  "peerDependencies": {
40
- "react": "^17.0.0 || ^18.0.0"
41
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
41
42
  },
42
43
  "scripts": {
43
44
  "build": "node esbuild.config.js",