-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: create prerequisites for icons package
- Loading branch information
1 parent
aa0e142
commit b7e735d
Showing
4 changed files
with
528 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import {Meta, ColorPalette, ColorItem, IconGallery, IconItem, Source} from '@storybook/addon-docs'; | ||
import dedent from 'ts-dedent'; | ||
import StoryConfig from '../../story-config.ts'; | ||
import defaultTheme from '../../../src/theme/default-theme'; | ||
import * as OxygenIcons from '@oxygen-ui/react-icons'; | ||
|
||
export const meta = { | ||
title: StoryConfig.Icons.hierarchy, | ||
}; | ||
|
||
<Meta title={meta.title} /> | ||
|
||
# Icons | ||
|
||
- [Overview](#overview) | ||
- [All Icons](#colors) | ||
|
||
## Overview | ||
|
||
The SVG icons from `@oxygen-ui/primitives` exported as React components. | ||
|
||
## Usage | ||
|
||
Import and use the icons in your components as follows. | ||
|
||
<Source | ||
language="jsx" | ||
dark | ||
format | ||
code={dedent` | ||
import {LockIcon} from '@oxygen-ui/react-icons';\n | ||
function Demo() { | ||
return <LockIcon size="small" />; | ||
}`} | ||
/> | ||
|
||
## All Icons | ||
|
||
<IconGallery> | ||
{Object.keys(OxygenIcons).map(key => { | ||
const Icon = OxygenIcons[key]; | ||
return ( | ||
<IconItem name={Icon.displayName}> | ||
<Icon /> | ||
</IconItem> | ||
); | ||
})} | ||
</IconGallery> |
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.