Skip to content

Commit a17342b

Browse files
authored
Revert "Rename SVG -> Icon"
1 parent 195d3b7 commit a17342b

File tree

6 files changed

+7
-37
lines changed

6 files changed

+7
-37
lines changed

packages/basehub/react-icon.d.ts

-1
This file was deleted.

packages/basehub/react-icon.js

-1
This file was deleted.

packages/basehub/src/react/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ export {
55
type CustomBlocksBase,
66
type HandlerProps as RichTextHandlerProps,
77
} from "./rich-text/primitive";
8-
export { SVG, Icon } from "./icon/primitive";
8+
export { SVG } from "./svg/primitive";

packages/basehub/src/react/icon/primitive.tsx packages/basehub/src/react/svg/primitive.tsx

+5-32
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ const parseStyleString = (styleString: string): React.CSSProperties => {
110110
};
111111

112112
/* COMPONENT */
113-
export const Icon = ({
113+
114+
export const SVG = ({
114115
content: _content,
115116
children,
116117
components = DEFAULT_COMPONENTS,
@@ -211,11 +212,9 @@ export const Icon = ({
211212
.filter(Boolean);
212213

213214
// Create the component with children if they exist
214-
return children.length > 0 ? (
215-
<Component {...props}>{children}</Component>
216-
) : (
217-
<Component {...props} />
218-
);
215+
return children.length > 0
216+
? React.createElement(tag, props, children)
217+
: React.createElement(tag, props);
219218
};
220219

221220
if (!svgElement) return null;
@@ -231,29 +230,3 @@ export const Icon = ({
231230

232231
return parseAndRenderSVG as React.ReactElement;
233232
};
234-
235-
interface SVGProps {
236-
content: string;
237-
/**
238-
* @deprecated Use `content` instead.
239-
*/
240-
children?: string;
241-
components?: Partial<ComponentsOverride>;
242-
}
243-
244-
/**
245-
* @deprecated Use the `Icon` component instead.
246-
*/
247-
export const SVG: React.FC<SVGProps> = ({
248-
content: _content,
249-
children,
250-
components = DEFAULT_COMPONENTS,
251-
}) => {
252-
console.warn(
253-
"Warning: The SVG component is deprecated and will be removed in the next major version. Please use the Icon component instead."
254-
);
255-
256-
const content = _content ?? children;
257-
258-
return <Icon content={content} components={components} />;
259-
};

packages/basehub/tsup-client.config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export default defineConfig((_options: Options) => {
77
minify: false,
88
dts: true,
99
entry: {
10-
"react-svg": "./src/react/icon/index.ts",
11-
"react-icon": "./src/react/icon/index.ts",
10+
"react-svg": "./src/react/svg/index.ts",
1211
"react-rich-text": "./src/react/rich-text/index.ts",
1312
"react-form": "./src/react/form/index.ts",
1413
"react-code-block/index": "./src/react/code-block/index.ts",

0 commit comments

Comments
 (0)