Skip to content

Commit

Permalink
refactor: moved Icon.tsx to primitives/Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Oct 23, 2024
1 parent 4eb0dde commit aeed75e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/primitives/Icon/Icon.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Meta, Title, Primary, Stories, Controls, Story } from "@storybook/blocks";
import * as IconStories from "./Icon.stories";
import { Icon } from "./Icon";

# Icon

<Meta of={IconStories} />

The Icon component abstracts away the SVG rendering of icons accepting props for the `type`, `color`, and `size`.

# Example

## Default

<Story of={IconStories.Default} />

# Controls

<Controls />

# Other variations

<Stories />
File renamed without changes.
4 changes: 2 additions & 2 deletions src/primitives/Icon.tsx → src/primitives/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const iconComponents: Record<IconProps["type"], React.FC<React.SVGProps<SVGSVGEl

export const Icon: React.FC<IconProps & React.SVGProps<SVGSVGElement>> = ({
type,
color,
size,
color = "black",
size = "20px",
className,
...props
}) => {
Expand Down
1 change: 1 addition & 0 deletions src/primitives/Icon/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Icon";

0 comments on commit aeed75e

Please sign in to comment.