Skip to content

Commit

Permalink
Merge pull request #145 from basehub-ai/add-supported-icon-tags
Browse files Browse the repository at this point in the history
Add support for 'radialGradient' and 'pattern' SVG tags in Icon component
  • Loading branch information
fabroos authored Jan 22, 2025
2 parents f315a61 + ffa7672 commit 6469d77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-hornets-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

Add support for 'radialGradient' and 'pattern' SVG tags in Icon component
4 changes: 4 additions & 0 deletions packages/basehub/src/react/icon/primitive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const supportedSvgTags = [
"linearGradient",
"stop",
"clipPath",
"radialGradient",
"pattern",
] as const;

type SvgComponent = (typeof supportedSvgTags)[number];
Expand Down Expand Up @@ -53,6 +55,8 @@ const DEFAULT_COMPONENTS: ComponentsOverride = {
linearGradient: (props) => React.createElement("linearGradient", props),
stop: (props) => React.createElement("stop", props),
clipPath: (props) => React.createElement("clipPath", props),
radialGradient: (props) => React.createElement("radialGradient", props),
pattern: (props) => React.createElement("pattern", props),
};

const XML_NAMESPACE_MAPPING: Record<string, string> = {
Expand Down

0 comments on commit 6469d77

Please sign in to comment.