@snorose/icons 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -0
- package/dist/{il-trashcan-circle-Bds-1V4d.js → il-tv-C16_fe9r.js} +3552 -126
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# @snorose/icons
|
|
2
|
+
|
|
3
|
+
스노로즈에서 사용하는 아이콘과 일러스트레이션을 React 컴포넌트 형태로 제공하는 패키지입니다.
|
|
4
|
+
|
|
5
|
+
패키지는 다음 세 종류의 에셋을 제공합니다.
|
|
6
|
+
|
|
7
|
+
- **Basic Icon**: 단색 아이콘
|
|
8
|
+
- **Multi Icon**: 여러 색상을 사용하는 아이콘
|
|
9
|
+
- **Illustration**: 일러스트레이션
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @snorose/icons
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
React 18 또는 19 환경을 지원합니다.
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
모든 아이콘과 일러스트레이션은 package root에서 named export됩니다.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { IconSearch } from '@snorose/icons';
|
|
33
|
+
|
|
34
|
+
function SearchButton() {
|
|
35
|
+
return <IconSearch />;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 크기 지정
|
|
40
|
+
|
|
41
|
+
별도의 `size` prop은 제공하지 않습니다.
|
|
42
|
+
|
|
43
|
+
SVG의 `width`, `height`를 사용해 크기를 지정합니다.
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import { IconSearch } from '@snorose/icons';
|
|
47
|
+
|
|
48
|
+
function SearchButton() {
|
|
49
|
+
return <IconSearch width={24} height={24} />;
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 색상 지정
|
|
54
|
+
|
|
55
|
+
`color` prop 또는 CSS의 `color` 속성을 통해 색상을 변경할 수 있습니다.
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<IconSearch width={24} height={24} color="#000000" />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<IconSearch className="search-icon" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
.search-icon {
|
|
67
|
+
color: #000000;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Multi Icon과 Illustration은 자체 색상을 가지므로 일반적으로 `color`를 이용해 내부 색상을 변경하지 않습니다.
|
|
72
|
+
|
|
73
|
+
## Props
|
|
74
|
+
|
|
75
|
+
아이콘 컴포넌트는 SVG root element에 전달할 수 있는 일반적인 SVG props를 사용할 수 있습니다.
|
|
76
|
+
|
|
77
|
+
예:
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<IconSearch
|
|
81
|
+
width={24}
|
|
82
|
+
height={24}
|
|
83
|
+
color="currentColor"
|
|
84
|
+
className="search-icon"
|
|
85
|
+
style={{ flexShrink: 0 }}
|
|
86
|
+
aria-hidden="true"
|
|
87
|
+
/>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
주로 사용하는 props는 다음과 같습니다.
|
|
91
|
+
|
|
92
|
+
- `width`
|
|
93
|
+
- `height`
|
|
94
|
+
- `color`
|
|
95
|
+
- `className`
|
|
96
|
+
- `style`
|
|
97
|
+
- `aria-*`
|
|
98
|
+
- `role`
|
|
99
|
+
- SVG element에서 사용할 수 있는 event handler
|
|
100
|
+
|
|
101
|
+
별도의 `size` prop과 ref forwarding은 지원하지 않습니다.
|
|
102
|
+
|
|
103
|
+
## Accessibility
|
|
104
|
+
|
|
105
|
+
아이콘 컴포넌트 자체에서 접근성 속성을 자동으로 지정하지 않습니다.
|
|
106
|
+
|
|
107
|
+
장식 목적으로만 사용하는 아이콘은 스크린 리더에서 제외할 수 있습니다.
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<IconSearch aria-hidden="true" />
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
아이콘 자체가 의미를 전달해야 하는 경우 적절한 접근성 정보를 제공해야 합니다.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
<IconSearch role="img" aria-label="검색" />
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
버튼 내부에서 아이콘을 사용하는 경우에는 가능하면 아이콘 자체보다 버튼에 접근 가능한 이름을 제공합니다.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<button type="button" aria-label="검색">
|
|
123
|
+
<IconSearch aria-hidden="true" />
|
|
124
|
+
</button>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Docs
|
|
128
|
+
|
|
129
|
+
- [@snorose-icons/naming-convention](docs/icon-naming-convention.md)
|
|
130
|
+
- [@snorose-icons/versioning-convention](docs/package-versioning-convention.md)
|
|
131
|
+
- [@snorose-icons/management](docs/icon-management.md)
|
|
132
|
+
- [@snorose-icons/release](docs/release-guide.md)
|