forked from kubesphere/kube-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ff24e8
commit 3a35bbb
Showing
13 changed files
with
143 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'kubed-documents': minor | ||
--- | ||
|
||
fix: add Icon docs |
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,20 @@ | ||
--- | ||
group: 'Icons' | ||
title: Icons | ||
description: Semantic vector graphics | ||
order: 1 | ||
--- | ||
|
||
# Icon | ||
Semantic vector graphics. | ||
|
||
# Instructions | ||
To use icon components, you need to install the @kubed/icons icon component package | ||
|
||
``` bash | ||
npm install @kubed/icons | ||
``` | ||
|
||
# Icon list | ||
|
||
<IconList/> |
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,20 @@ | ||
--- | ||
group: 'Icons' | ||
title: Icons | ||
description: 语义化的矢量图形 | ||
order: 1 | ||
--- | ||
|
||
# Icon 图标 | ||
语义化的矢量图形。 | ||
|
||
# 使用方法 | ||
使用图标组件,你需要安装 @kubed/icons 图标组件包 | ||
|
||
``` bash | ||
npm install @kubed/icons | ||
``` | ||
|
||
# 图标列表 | ||
|
||
<IconList/> |
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,46 @@ | ||
import * as KubeIcon from '@kubed/icons'; | ||
import styled from 'styled-components'; | ||
import { Text, notify, Notify } from "@kubed/components"; | ||
import { useClipboard } from "@kubed/hooks"; | ||
|
||
const Content = styled.div` | ||
cursor: pointer; | ||
width: 100px; | ||
height: 90px; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: center; | ||
&:hover { | ||
background-color: ${({ theme }) => theme.palette.accents_1}; | ||
} | ||
`; | ||
const GridContent = styled.div` | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, 90px); | ||
grid-gap: 5px; | ||
`; | ||
|
||
const IconList = () => { | ||
const icons = Object.entries(KubeIcon); | ||
const { copy } = useClipboard() | ||
const renderIconList = () => { | ||
return icons.map((icon) => { | ||
const [iconName, Svg] = icon; | ||
return ( | ||
<Content key={iconName} onClick={() => { | ||
const copyElement = `<${iconName}/>` | ||
copy(copyElement) | ||
notify.success(copyElement+ ' copied 🎉') | ||
}}> | ||
<Svg size={48} /> | ||
<Text>{iconName}</Text> | ||
</Content> | ||
); | ||
}); | ||
}; | ||
|
||
return <GridContent>{renderIconList()}<Notify position="top-right" /></GridContent>; | ||
}; | ||
|
||
export default IconList; |
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
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