-
Notifications
You must be signed in to change notification settings - Fork 762
feat(react-icons): introduce granular export maps for svg utils #953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
|
|
||
| export default bundleIcon; | ||
| export const bundleIcon = (FilledIcon: FluentIcon, RegularIcon: FluentIcon): FluentIcon => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added only explicit return annotation - the body was reformatted by prettier
| * Whether to render the filled version of the icon. | ||
| * NOTE: This prop is only applicable when using bundled icons created with `bundleIcon`. | ||
| */ | ||
| filled?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to have two separate types like:
export type FluentIconsProps<
TBaseAttributes extends
| React.SVGAttributes<SVGElement>
| React.HTMLAttributes<HTMLElement> = React.SVGAttributes<SVGElement>,
TRefType extends HTMLElement | SVGSVGElement = SVGSVGElement,
> = TBaseAttributes &
React.RefAttributes<TRefType> & {
primaryFill?: string;
className?: string;
title?: string;
}
export type FluentCompoundIconProps<
TBaseAttributes extends
| React.SVGAttributes<SVGElement>
| React.HTMLAttributes<HTMLElement> = React.SVGAttributes<SVGElement>,
TRefType extends HTMLElement | SVGSVGElement = SVGSVGElement,
> = FluentIconsProps<TBaseAttributes> & {
/**
* Whether to render the filled version of the icon.
*/
filled?: boolean;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does, but if we do this it would break user pipeline if someone "by accident" set filled on normal icon
dbe0b03 to
04b9f91
Compare
04b9f91 to
108cf7c
Compare
Introduces another public api endpoint for svg related utilities to improve tree-shaking and bundle size ->
@fluentui/react-icons/utilsBefore:
After
Additional changes
bundleIconfrom default to named export for better three shakingfilledproperty propagation to<svg>