-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add icon and banner props * better dx * add svgs to everything * combine sdsicon and svgicon, rename prop * fix double icon Co-authored-by: Timmy Huang <[email protected]> * feat(icon): custom svg icon support in sds components Custom svg icon support has been added to all the SDS components that accepted icon in some form Please refer to the PR description about custom svg icon support * refactor(icon): fix prop name * refactor(buttonicon): fix prop name * fix(deprecation): add deprecation notes for the old sdsIcon prop on ButtonIcon and MenuItem --------- Co-authored-by: Timmy Huang <[email protected]> Co-authored-by: Masoud Amjadi <[email protected]>
- Loading branch information
1 parent
3fc888b
commit f71236f
Showing
46 changed files
with
507 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Icon, { IconProps } from "../core/Icon"; | ||
|
||
/** | ||
* CustomSdsIcon is an Icon component built on top of the core SDS Icon. | ||
* This custom component is designed for use in Storybook demos, | ||
* allowing easy customization. | ||
*/ | ||
function CustomSdsIcon(props: { | ||
sdsIcon?: IconProps<"bacteria">["sdsIcon"]; | ||
sdsSize?: IconProps<"bacteria">["sdsSize"]; | ||
sdsType?: IconProps<"bacteria">["sdsType"]; | ||
color?: IconProps<"bacteria">["color"]; | ||
}) { | ||
const { | ||
sdsIcon = "bacteria", | ||
sdsSize = "l", | ||
sdsType = "static", | ||
color = "primary", | ||
...rest | ||
} = props; | ||
return ( | ||
<Icon | ||
sdsIcon={sdsIcon} | ||
sdsSize={sdsSize} | ||
sdsType={sdsType} | ||
color={color} | ||
{...rest} | ||
/> | ||
); | ||
} | ||
|
||
export default CustomSdsIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { SvgIcon, SvgIconProps } from "@mui/material"; | ||
|
||
/** | ||
* CustomSvgIcon is a component that extends the SvgIcon component from the Material-UI library. | ||
* It allows easy usage of custom SVG icons with in the storybook demos. | ||
*/ | ||
function CustomSvgIcon(props: SvgIconProps) { | ||
return ( | ||
<SvgIcon color="primary" viewBox="2 2 20 20" {...props}> | ||
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" /> | ||
</SvgIcon> | ||
); | ||
} | ||
|
||
export default CustomSvgIcon; |
2 changes: 1 addition & 1 deletion
2
packages/components/src/core/Accordion/components/AccordionHeader/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.