This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: 📝 add iconography storybook story
- Loading branch information
Showing
5 changed files
with
997 additions
and
9 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,24 @@ | ||
.iconItemStyle { | ||
border-radius: 4px; | ||
background: #00000082; | ||
box-shadow: rgba(0, 0, 0, 0.10) 0 1px 3px 0; | ||
border: 1px solid hsla(203, 50%, 30%, 0.15); | ||
overflow: hidden; | ||
height: 40px; | ||
width: 40px; | ||
display: -webkit-box; | ||
display: -webkit-flex; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-align-items: center; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
-webkit-justify-content: center; | ||
justify-content: center; | ||
-webkit-flex: none; | ||
-ms-flex: none; | ||
flex: none; | ||
} |
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,18 @@ | ||
import {IconGallery, IconItem, Meta} from '@storybook/blocks'; | ||
|
||
import {ICON_OPTIONS} from './storybook'; | ||
import styles from './icons.module.scss' | ||
|
||
<Meta title='global/iconography' /> | ||
|
||
# Iconography | ||
|
||
<IconGallery> | ||
{Object.entries(ICON_OPTIONS).map(([iconName, iconComponent]) => ( | ||
<IconItem name={iconName} key={iconName}> | ||
<div className={styles.iconItemStyle}> | ||
{iconComponent} | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as ICONS from './index'; | ||
|
||
type IconOptions = Record<keyof typeof ICONS, React.ReactNode>; | ||
export const ICON_OPTIONS = Object.entries(ICONS).reduce<IconOptions>( | ||
(acc, [iconName, IconComponent]) => { | ||
acc[iconName.replace(/icon$/i, '') as keyof typeof ICONS] = IconComponent({}); | ||
return acc; | ||
}, | ||
{} as IconOptions | ||
); |
Oops, something went wrong.