insystem-atoms 0.1.0 → 0.1.2

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 CHANGED
@@ -21,12 +21,14 @@ npm install insystem-atoms styled-components
21
21
  ## 빠른 시작
22
22
 
23
23
  ```tsx
24
- import { Button, Input, Checkbox } from 'insystem-atoms';
24
+ import { IsButton, Input, Checkbox } from 'insystem-atoms';
25
25
 
26
26
  function App() {
27
27
  return (
28
28
  <>
29
- <Button variant="primary" onClick={handleSave}>저장</Button>
29
+ <IsButton variant="solid" color="primary" onClick={handleSave}>
30
+ 저장
31
+ </IsButton>
30
32
  <Input label="이름" required placeholder="홍길동" />
31
33
  <Checkbox label="동의합니다" checked={agreed} onChange={setAgreed} />
32
34
  </>
@@ -62,28 +64,123 @@ configureTokens({
62
64
 
63
65
  ## 컴포넌트
64
66
 
65
- ### Button
67
+ ### IsButton
68
+
69
+ Figma **IsButton** 스펙에 맞춘 버튼입니다. 색·타이포·패딩 등은 디자인 파일과 동일하게 고정되어 있으며, `borderRadius` / `padding` 같은 인라인 스타일 오버라이드 props는 제공하지 않습니다. (앱 전역 톤은 `configureTokens`로 조정.)
66
70
 
67
71
  ```tsx
68
- import { Button } from 'insystem-atoms';
72
+ import { IsButton } from 'insystem-atoms';
69
73
 
70
- <Button variant="primary">저장</Button>
71
- <Button variant="secondary" size="sm">취소</Button>
72
- <Button variant="danger" loading>삭제 중...</Button>
73
- <Button variant="primary" fullWidth>전체 너비</Button>
74
- <Button leftIcon={<PlusIcon />}>추가</Button>
74
+ <IsButton variant="solid" color="primary">저장</IsButton>
75
+ <IsButton variant="outlined" color="primary" size="sm">취소</IsButton>
76
+ <IsButton variant="solid" color="secondary" loading>처리 중…</IsButton>
77
+ <IsButton variant="solid" color="primary" leftIcon leftIconSlot={<PlusIcon />}>추가</IsButton>
78
+ <IsButton variant="solid" color="primary" iconOnly iconSlot={<SearchIcon />} aria-label="검색" />
75
79
  ```
76
80
 
77
81
  | Prop | 타입 | 기본값 | 설명 |
78
82
  |------|------|--------|------|
79
- | `variant` | `primary` \| `secondary` \| `success` \| `warning` \| `danger` \| `ghost` \| `admin` \| `neutral` \| `conversion` \| `icon` | `primary` | 버튼 스타일 |
80
- | `size` | `xs` \| `sm` \| `md` \| `lg` | `md` | 크기 |
81
- | `loading` | `boolean` | `false` | 로딩 스피너 표시 |
82
- | `fullWidth` | `boolean` | `false` | 컨테이너 전체 너비 |
83
- | `width` | `string \| number` | | 고정 너비 |
84
- | `leftIcon` | `ReactNode` | | 좌측 아이콘 슬롯 |
85
- | `rightIcon` | `ReactNode` | | 우측 아이콘 슬롯 |
86
- | `iconOnly` | `boolean` | `false` | 아이콘 전용 (텍스트 숨김) |
83
+ | `variant` | `solid` \| `outlined` | `solid` | Figma Variant |
84
+ | `color` | `primary` \| `secondary` | `primary` | Figma Color |
85
+ | `size` | `xs` \| `sm` \| `md` \| `lg` \| `xl` | `md` | XSmall ~ XLarge |
86
+ | `loading` | `boolean` | `false` | 로딩 스피너 |
87
+ | `disabled` | `boolean` | `false` | 비활성 |
88
+ | `iconOnly` | `boolean` | `false` | 아이콘만 표시 |
89
+ | `leftIcon` | `boolean` | `false` | 좌측 아이콘 영역 사용 시 `true` + `leftIconSlot` |
90
+ | `rightIcon` | `boolean` | `false` | 우측 아이콘 영역 사용 `true` + `rightIconSlot` |
91
+ | `leftIconSlot` | `ReactNode` | — | 좌측 아이콘 노드 |
92
+ | `rightIconSlot` | `ReactNode` | — | 우측 아이콘 노드 |
93
+ | `iconSlot` | `ReactNode` | — | `iconOnly`일 때 아이콘 (없으면 `children` 사용) |
94
+ | `interaction` | `boolean` | `true` | 호버/포커스/프레스 오버레이 (Figma Interaction) |
95
+
96
+ 허용 문자열 상수는 `IS_BUTTON_PROP_VALUES` export로 확인할 수 있습니다.
97
+
98
+ ### IsTextButton
99
+
100
+ Figma **IsTextButton** 스펙의 텍스트형 버튼입니다. 배경 없이 라벨·아이콘·로딩만 표시하며, 색·타이포·패딩·인터랙션 오버레이는 디자인 파일과 동일하게 고정되어 있습니다.
101
+
102
+ ```tsx
103
+ import { IsTextButton } from 'insystem-atoms';
104
+
105
+ <IsTextButton color="primary">더보기</IsTextButton>
106
+ <IsTextButton color="secondary" size="sm">취소</IsTextButton>
107
+ <IsTextButton color="primary" loading>처리 중…</IsTextButton>
108
+ <IsTextButton color="primary" leftIcon leftIconSlot={<PlusIcon />}>추가</IsTextButton>
109
+ ```
110
+
111
+ | Prop | 타입 | 기본값 | 설명 |
112
+ |------|------|--------|------|
113
+ | `color` | `primary` \| `secondary` | `primary` | Figma Color |
114
+ | `size` | `md` \| `sm` | `md` | Medium / Small |
115
+ | `loading` | `boolean` | `false` | 로딩 스피너 |
116
+ | `disabled` | `boolean` | `false` | 비활성 |
117
+ | `leftIcon` | `boolean` | `false` | 좌측 아이콘 영역 + `leftIconSlot` |
118
+ | `rightIcon` | `boolean` | `false` | 우측 아이콘 영역 + `rightIconSlot` |
119
+ | `leftIconSlot` | `ReactNode` | — | 좌측 아이콘 |
120
+ | `rightIconSlot` | `ReactNode` | — | 우측 아이콘 |
121
+ | `interaction` | `boolean` | `true` | 호버/포커스/프레스 오버레이 (Primary는 `#0066FF`, Secondary는 `#171719` 레이어) |
122
+
123
+ 허용 문자열은 `IS_TEXT_BUTTON_PROP_VALUES`로 확인할 수 있습니다.
124
+
125
+ ### IsChip
126
+
127
+ Figma **IsChip** 스펙의 칩(토글)입니다. Solid / Outlined, 네 가지 크기, Active·Disable·좌우 아이콘·Interaction 오버레이가 디자인 파일과 동일하게 고정되어 있습니다. (기존 `Chip`은 레거시·토큰 오버라이드용으로 남겨 두었습니다.)
128
+
129
+ ```tsx
130
+ import { IsChip } from 'insystem-atoms';
131
+
132
+ <IsChip variant="solid" size="md">필터</IsChip>
133
+ <IsChip variant="outlined" active>선택됨</IsChip>
134
+ <IsChip variant="solid" active disabled>비활성 선택</IsChip>
135
+ <IsChip variant="outlined" leftIcon leftIconSlot={<PlusIcon />}>추가</IsChip>
136
+ ```
137
+
138
+ | Prop | 타입 | 기본값 | 설명 |
139
+ |------|------|--------|------|
140
+ | `variant` | `solid` \| `outlined` | `solid` | Figma Variant |
141
+ | `size` | `xs` \| `sm` \| `md` \| `lg` | `md` | XSmall / Small / Medium / Large |
142
+ | `active` | `boolean` | `false` | 선택(pressed) 상태 |
143
+ | `disabled` | `boolean` | `false` | 비활성 |
144
+ | `leftIcon` | `boolean` | `false` | 좌측 아이콘 + `leftIconSlot` |
145
+ | `rightIcon` | `boolean` | `false` | 우측 아이콘 + `rightIconSlot` |
146
+ | `leftIconSlot` | `ReactNode` | — | 좌측 아이콘 |
147
+ | `rightIconSlot` | `ReactNode` | — | 우측 아이콘 |
148
+ | `interaction` | `boolean` | `true` | 호버/포커스/프레스 오버레이 |
149
+
150
+ 허용 문자열은 `IS_CHIP_PROP_VALUES`로 확인할 수 있습니다.
151
+
152
+ ### IsInputSearch
153
+
154
+ Figma **IsInputSearch** (178:244) 스펙의 검색 입력입니다. 크기·상태·라벨 위치·Prefix/Suffix/Clearable/Placeholder 표시는 디자인과 동일한 고정 토큰입니다.
155
+
156
+ ```tsx
157
+ import { IsInputSearch } from 'insystem-atoms';
158
+
159
+ <IsInputSearch size="md" suffix suffixSlot={<SearchIcon />} />
160
+ <IsInputSearch labelPosition="row" prefix prefixSlot={<SearchIcon />} suffix={false} />
161
+ <IsInputSearch clearable suffix suffixSlot={<SearchIcon />} defaultValue="검색" />
162
+ <IsInputSearch error="올바른 형식이 아닙니다." suffix suffixSlot={<SearchIcon />} />
163
+ ```
164
+
165
+ | Prop | 타입 | 기본값 | Figma 대응 |
166
+ |------|------|--------|------------|
167
+ | `size` | `xs` \| `sm` \| `md` \| `lg` | `md` | XSmall ~ Large |
168
+ | `labelPosition` | `column` \| `row` | `column` | Position |
169
+ | `labelShow` | `boolean` | `true` | LabelShow |
170
+ | `label` | `string` | `Label` | 라벨 텍스트 |
171
+ | `required` | `boolean` | — | 라벨 `*` (선택) |
172
+ | `prefix` | `boolean` | `false` | Prefix |
173
+ | `prefixSlot` | `ReactNode` | — | 접두 아이콘 |
174
+ | `suffix` | `boolean` | `true` | Suffix |
175
+ | `suffixSlot` | `ReactNode` | — | 접미 아이콘 |
176
+ | `clearable` | `boolean` | `false` | Clearable |
177
+ | `placeholderShown` | `boolean` | `true` | Placeholder |
178
+ | `placeholder` | `string` | `입력해주세요.` | placeholder |
179
+ | `error` | `string` | — | 에러 메시지(있으면 테두리 `#FF4242`) |
180
+ | `fullWidth` | `boolean` | `true` | — |
181
+ | `width` | `string` \| `number` | — | 고정 너비 |
182
+
183
+ 허용 문자열은 `IS_INPUT_SEARCH_PROP_VALUES`로 확인할 수 있습니다. 에러 문구 예시는 `IS_INPUT_SEARCH_FIGMA_ERROR_MESSAGE`와 동일합니다.
87
184
 
88
185
  ---
89
186
 
@@ -232,6 +329,8 @@ import { Badge } from 'insystem-atoms';
232
329
 
233
330
  ### Chip
234
331
 
332
+ 디자인 시스템 **IsChip**과 동일한 UI가 필요하면 `IsChip`을 사용하세요. 아래 `Chip`은 `label`·`count`·`activeColor` 등 토큰 기반 오버라이드가 필요한 기존 API입니다.
333
+
235
334
  ```tsx
236
335
  import { Chip } from 'insystem-atoms';
237
336
 
@@ -300,22 +399,20 @@ const [visible, setVisible] = useState(false);
300
399
 
301
400
  ## 스타일 오버라이드 Props
302
401
 
303
- 모든 컴포넌트에 아래 props 사용해 인라인으로 스타일을 변경할 수 있습니다.
402
+ 대부분의 컴포넌트에 아래 props 인라인 스타일을 덮어쓸 수 있습니다. **IsButton**은 Figma 고정 스펙이라 해당 오버라이드를 지원하지 않습니다.
304
403
 
305
404
  ```tsx
306
- <Button borderRadius="20px">둥근 버튼</Button>
307
- <Button backgroundColor="#7C3AED" textColor="#fff">보라 버튼</Button>
308
405
  <Input borderColor="#7C3AED" borderRadius="8px" />
309
406
  <Badge backgroundColor="#f0fdf4" textColor="#166534">커스텀</Badge>
310
407
  ```
311
408
 
312
409
  | Prop | 컴포넌트 | 설명 |
313
410
  |------|----------|------|
314
- | `borderRadius` | 전체 | 모서리 반경 |
315
- | `borderColor` | 전체 | 테두리 색상 |
316
- | `textColor` | 전체 | 텍스트/전경 색상 |
317
- | `backgroundColor` | 전체 | 배경색 |
318
- | `padding` | Button, Input, TextArea | 내부 여백 |
411
+ | `borderRadius` | Input, TextArea, Badge 등 | 모서리 반경 |
412
+ | `borderColor` | Input, TextArea, Badge 등 | 테두리 색상 |
413
+ | `textColor` | Input, TextArea, Badge 등 | 텍스트/전경 색상 |
414
+ | `backgroundColor` | Input, TextArea, Badge 등 | 배경색 |
415
+ | `padding` | Input, TextArea | 내부 여백 |
319
416
  | `checkColor` | Checkbox, Radio | 체크/선택 활성 색상 |
320
417
  | `activeColor` | Chip, Pagination | 활성 상태 색상 |
321
418
 
@@ -356,7 +453,15 @@ resetTokens();
356
453
  모든 컴포넌트는 완전한 타입을 지원합니다.
357
454
 
358
455
  ```ts
359
- import type { ButtonProps, InputProps, Size, Variant } from 'insystem-atoms';
456
+ import type {
457
+ IsButtonProps,
458
+ IsChipProps,
459
+ IsInputSearchProps,
460
+ IsTextButtonProps,
461
+ InputProps,
462
+ Size,
463
+ Variant,
464
+ } from 'insystem-atoms';
360
465
  ```
361
466
 
362
467
  ---