Skip to content

Commit

Permalink
docs(Icon): add v2 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartSquared committed Aug 29, 2024
1 parent 6ea42bc commit e8959a1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Canvas, Controls, Meta, Story } from "@storybook/blocks"
import { ResourceLinks } from "~storybook/components"
import { ResourceLinks, KAIOInstallation } from "~storybook/components"
import * as IconStories from "./Icon.stories"

<Meta of={IconStories} />
Expand All @@ -8,16 +8,13 @@ import * as IconStories from "./Icon.stories"

<ResourceLinks
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Icons"

/>

## Installation

Each icon is imported separately, for example if you'd like the `AddIcon` you will use the following import.

```js
import { AddIcon } from "@kaizen/components"
```
<KAIOInstallation exportNames={["AddIcon" ]} family="illustrations" version="1" />

See: Reference for all icons available to import.

Expand All @@ -36,7 +33,7 @@ There are two ways you can apply the colour:

1. Add a `classNameOverride` to the icon element

```jsx
```tsx
<AddIcon classNameOverride="text-blue-500" />
```

Expand Down
48 changes: 48 additions & 0 deletions packages/components/src/__illustrations__/Icon/v2/_docs/Icon.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Canvas, Controls, Meta, Story } from "@storybook/blocks"
import { ResourceLinks, KAIOInstallation } from "~storybook/components"
import * as IconStories from "../../v1/_docs/Icon.stories"

<Meta title="Illustrations/Icon/Icon (v2)"/>

# Icon

<ResourceLinks
sourceCode="https://github.com/cultureamp/kaizen-design-system/tree/main/packages/components/src/Icons"
/>

## Installation

Each icon is imported separately, for example if you'd like the `AddIcon` you will use the following import.

<KAIOInstallation exportNames={["AddIcon" ]} family="illustrations" version="2" />

See: Reference for all icons available to import.

## Overview

All Icon components can be meaningful or presentational icons.

<Canvas of={IconStories.Playground} />
<Controls of={IconStories.Playground} />

## Applying Colour

Icon's inherit the text colour through `currentColor`.

There are two ways you can apply the colour:

1. Add a `classNameOverride` to the icon element

```tsx
<AddIcon classNameOverride="text-blue-500" />
```

2. Change the text colour of the wrapping element

<Canvas of={IconStories.ApplyColour} sourceState="shown" />

## Reference

Tip: click on the icon you want for a quick copy!

<Story of={IconStories.Reference} />
1 change: 1 addition & 0 deletions packages/components/src/__illustrations__/Icon/v2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "../v1"

0 comments on commit e8959a1

Please sign in to comment.