@opsnow-mcp/opsnow-mcp-common-ui-server 1.0.21 → 1.0.23
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/build/components/data/icon-names.js +129 -0
- package/build/components/examples/opsnow-common-calendar-examples-data.js +48 -0
- package/build/components/examples/opsnow-common-chart-examples-data.js +6843 -0
- package/build/components/examples/opsnow-common-data-status-examples-data.js +65 -0
- package/build/components/examples/opsnow-common-file-upload-examples-data.js +95 -0
- package/build/components/examples/opsnow-common-forms-examples-data.js +1715 -0
- package/build/components/examples/opsnow-common-grid-examples-data.js +2389 -0
- package/build/components/examples/opsnow-common-icons-examples-data.js +72 -0
- package/build/components/examples/opsnow-common-layout-examples-data.js +97 -0
- package/build/components/examples/opsnow-common-notification-examples-data.js +78 -0
- package/build/components/examples/opsnow-common-pagination-examples-data.js +82 -0
- package/build/components/examples/opsnow-common-popup-examples-data.js +205 -0
- package/build/components/examples/opsnow-common-progress-examples-data.js +86 -0
- package/build/components/examples/opsnow-common-select-examples-data.js +131 -0
- package/build/components/examples/opsnow-common-stepper-examples-data.js +180 -0
- package/build/components/examples/opsnow-common-storage-examples-data.js +8 -0
- package/build/components/examples/opsnow-common-tab-examples-data.js +87 -0
- package/build/components/examples/opsnow-common-toast-popup-examples-data.js +129 -0
- package/build/components/examples/opsnow-common-tooltip-examples-data.js +80 -0
- package/build/components/examples/opsnow-common-typography-examples-data.js +366 -0
- package/build/components/opsnow-common-calendar.js +228 -0
- package/build/components/opsnow-common-chart.js +1643 -0
- package/build/components/opsnow-common-data-status.js +116 -0
- package/build/components/opsnow-common-examples.js +109 -0
- package/build/components/opsnow-common-file-upload.js +57 -0
- package/build/components/opsnow-common-forms.js +1009 -0
- package/build/components/opsnow-common-grid.js +352 -0
- package/build/components/opsnow-common-icons.js +139 -0
- package/build/components/opsnow-common-layout.js +141 -0
- package/build/components/opsnow-common-notification.js +110 -0
- package/build/components/opsnow-common-pagination.js +164 -0
- package/build/components/opsnow-common-popup.js +71 -0
- package/build/components/opsnow-common-progress.js +177 -0
- package/build/components/opsnow-common-select.js +135 -0
- package/build/components/opsnow-common-stepper.js +72 -0
- package/build/components/opsnow-common-tab.js +111 -0
- package/build/components/opsnow-common-toast-popup.js +135 -0
- package/build/components/opsnow-common-tooltip.js +204 -0
- package/build/components/opsnow-common-typography.js +93 -0
- package/build/index.js +135 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1715 @@
|
|
|
1
|
+
// 각 컴포넌트별 예제 정보 export (opsnow-common-examples.ts에서 import해서 MCP 툴로 활용)
|
|
2
|
+
export const ButtonExamples = [
|
|
3
|
+
// === Large size examples ===
|
|
4
|
+
{
|
|
5
|
+
title: 'large-contained-primary-icon-left',
|
|
6
|
+
code: `<OpsnowCommonButton iconName="CloudPlus" label="Label" size="large" onClick={muiButtonTest} />`,
|
|
7
|
+
description: '대형 크기의 기본 Contained Primary 버튼 (왼쪽 아이콘) 예제입니다.'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
title: 'large-contained-secondary',
|
|
11
|
+
code: `<OpsnowCommonButton label="Label" size="large" color="secondary" onClick={muiButtonTest} />`,
|
|
12
|
+
description: '대형 크기의 Contained Secondary 버튼 예제입니다.'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
title: 'large-contained-error',
|
|
16
|
+
code: `<OpsnowCommonButton label="Label" size="large" color="error" onClick={muiButtonTest} />`,
|
|
17
|
+
description: '대형 크기의 Contained Error 버튼 예제입니다.'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: 'large-contained-inherit',
|
|
21
|
+
code: `<OpsnowCommonButton label="Label" size="large" color="inherit" onClick={muiButtonTest} />`,
|
|
22
|
+
description: '대형 크기의 Contained Inherit 버튼 예제입니다.'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: 'large-contained-inherit-white-theme',
|
|
26
|
+
code: `<OpsnowCommonButton label="Label" theme="white" size="large" color="inherit" onClick={muiButtonTest} />`,
|
|
27
|
+
description: '대형 크기의 흰 테마 Contained Inherit 버튼 예제입니다.'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: 'large-contained-disabled-white-theme',
|
|
31
|
+
code: `<OpsnowCommonButton label="Label" theme="white" size="large" disabled onClick={muiButtonTest} />`,
|
|
32
|
+
description: '대형 크기의 흰 테마 Disabled Contained 버튼 예제입니다.'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'large-outlined-primary-icon-right',
|
|
36
|
+
code: `<OpsnowCommonButton iconPosition="right" iconName="LogoAws" label="Label" variant="outlined" size="large" onClick={muiButtonTest} />`,
|
|
37
|
+
description: '대형 크기의 Outlined Primary 버튼 (오른쪽 아이콘) 예제입니다.'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: 'large-outlined-secondary',
|
|
41
|
+
code: `<OpsnowCommonButton label="Label" size="large" variant="outlined" color="secondary" onClick={muiButtonTest} />`,
|
|
42
|
+
description: '대형 크기의 Outlined Secondary 버튼 예제입니다.'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: 'large-outlined-error',
|
|
46
|
+
code: `<OpsnowCommonButton label="Label" size="large" variant="outlined" color="error" onClick={muiButtonTest} />`,
|
|
47
|
+
description: '대형 크기의 Outlined Error 버튼 예제입니다.'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: 'large-outlined-inherit',
|
|
51
|
+
code: `<OpsnowCommonButton label="Label" size="large" variant="outlined" color="inherit" onClick={muiButtonTest} />`,
|
|
52
|
+
description: '대형 크기의 Outlined Inherit 버튼 예제입니다.'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: 'large-outlined-inherit-white-theme',
|
|
56
|
+
code: `<OpsnowCommonButton label="Label" theme="white" size="large" variant="outlined" color="inherit" onClick={muiButtonTest} />`,
|
|
57
|
+
description: '대형 크기의 흰 테마 Outlined Inherit 버튼 예제입니다.'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: 'large-outlined-disabled',
|
|
61
|
+
code: `<OpsnowCommonButton label="Label" size="large" variant="outlined" disabled onClick={muiButtonTest} />`,
|
|
62
|
+
description: '대형 크기의 Disabled Outlined 버튼 예제입니다.'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: 'large-text-primary-icon-left',
|
|
66
|
+
code: `<OpsnowCommonButton iconName="PlusCircleOutline" label="Label" variant="text" size="large" onClick={muiButtonTest} />`,
|
|
67
|
+
description: '대형 크기의 Text Primary 버튼 (왼쪽 아이콘) 예제입니다.'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
title: 'large-text-secondary',
|
|
71
|
+
code: `<OpsnowCommonButton label="Label" variant="text" size="large" color="secondary" onClick={muiButtonTest} />`,
|
|
72
|
+
description: '대형 크기의 Text Secondary 버튼 예제입니다.'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
title: 'large-text-error',
|
|
76
|
+
code: `<OpsnowCommonButton label="Label" variant="text" size="large" color="error" onClick={muiButtonTest} />`,
|
|
77
|
+
description: '대형 크기의 Text Error 버튼 예제입니다.'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: 'large-text-inherit',
|
|
81
|
+
code: `<OpsnowCommonButton label="Label" variant="text" size="large" color="inherit" onClick={muiButtonTest} />`,
|
|
82
|
+
description: '대형 크기의 Text Inherit 버튼 예제입니다.'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: 'large-text-inherit-white-theme',
|
|
86
|
+
code: `<OpsnowCommonButton label="Label" variant="text" theme="white" size="large" color="inherit" onClick={muiButtonTest} />`,
|
|
87
|
+
description: '대형 크기의 흰 테마 Text Inherit 버튼 예제입니다.'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'large-text-disabled',
|
|
91
|
+
code: `<OpsnowCommonButton label="Label" variant="text" size="large" disabled onClick={muiButtonTest} />`,
|
|
92
|
+
description: '대형 크기의 Disabled Text 버튼 예제입니다.'
|
|
93
|
+
},
|
|
94
|
+
// === Medium size examples ===
|
|
95
|
+
{
|
|
96
|
+
title: 'medium-contained-primary-icon-left',
|
|
97
|
+
code: `<OpsnowCommonButton muiIconName="mic" label="Label" onClick={muiButtonTest} />`,
|
|
98
|
+
description: '중간 크기의 기본 Contained Primary 버튼 (왼쪽 아이콘) 예제입니다.'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
title: 'medium-contained-secondary',
|
|
102
|
+
code: `<OpsnowCommonButton label="Label" color="secondary" onClick={muiButtonTest} />`,
|
|
103
|
+
description: '중간 크기의 Contained Secondary 버튼 예제입니다.'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: 'medium-contained-error',
|
|
107
|
+
code: `<OpsnowCommonButton label="Label" color="error" onClick={muiButtonTest} />`,
|
|
108
|
+
description: '중간 크기의 Contained Error 버튼 예제입니다.'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: 'medium-contained-inherit',
|
|
112
|
+
code: `<OpsnowCommonButton label="Label" color="inherit" onClick={muiButtonTest} />`,
|
|
113
|
+
description: '중간 크기의 Contained Inherit 버튼 예제입니다.'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
title: 'medium-contained-inherit-white-theme',
|
|
117
|
+
code: `<OpsnowCommonButton label="Label" theme="white" color="inherit" onClick={muiButtonTest} />`,
|
|
118
|
+
description: '중간 크기의 흰 테마 Contained Inherit 버튼 예제입니다.'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
title: 'medium-contained-disabled',
|
|
122
|
+
code: `<OpsnowCommonButton label="Label" theme="white" disabled onClick={muiButtonTest} />`,
|
|
123
|
+
description: '중간 크기의 Disabled Contained 버튼 예제입니다.'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
title: 'medium-outlined-primary-icon-right',
|
|
127
|
+
code: `<OpsnowCommonButton iconPosition="right" iconName="LogoAws" label="Label" variant="outlined" onClick={muiButtonTest} />`,
|
|
128
|
+
description: '중간 크기의 Outlined Primary 버튼 (오른쪽 아이콘) 예제입니다.'
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
title: 'medium-outlined-secondary',
|
|
132
|
+
code: `<OpsnowCommonButton label="Label" variant="outlined" color="secondary" onClick={muiButtonTest} />`,
|
|
133
|
+
description: '중간 크기의 Outlined Secondary 버튼 예제입니다.'
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
title: 'medium-outlined-error',
|
|
137
|
+
code: `<OpsnowCommonButton label="Label" variant="outlined" color="error" onClick={muiButtonTest} />`,
|
|
138
|
+
description: '중간 크기의 Outlined Error 버튼 예제입니다.'
|
|
139
|
+
},
|
|
140
|
+
// === Loading examples ===
|
|
141
|
+
{
|
|
142
|
+
title: 'loading-contained-primary',
|
|
143
|
+
code: `<OpsnowCommonButton label="Save" loading onClick={handleSave} />`,
|
|
144
|
+
description: 'Contained Primary 버튼의 로딩 상태 예제입니다.'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
title: 'loading-outlined-primary',
|
|
148
|
+
code: `<OpsnowCommonButton label="Submit" variant="outlined" loading onClick={handleSubmit} />`,
|
|
149
|
+
description: 'Outlined Primary 버튼의 로딩 상태 예제입니다.'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
title: 'loading-text-primary',
|
|
153
|
+
code: `<OpsnowCommonButton label="Load More" variant="text" loading onClick={handleLoadMore} />`,
|
|
154
|
+
description: 'Text Primary 버튼의 로딩 상태 예제입니다.'
|
|
155
|
+
}
|
|
156
|
+
];
|
|
157
|
+
export const BadgeExamples = [
|
|
158
|
+
// === No children badge examples ===
|
|
159
|
+
{
|
|
160
|
+
title: 'badge-no-children-primary',
|
|
161
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="primary" />`,
|
|
162
|
+
description: '자식 없는 기본 Primary 배지 예제입니다.'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
title: 'badge-no-children-error',
|
|
166
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="error" />`,
|
|
167
|
+
description: '자식 없는 Error 배지 예제입니다.'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
title: 'badge-no-children-info',
|
|
171
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="info" />`,
|
|
172
|
+
description: '자식 없는 Info 배지 예제입니다.'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
title: 'badge-no-children-warning',
|
|
176
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="warning" />`,
|
|
177
|
+
description: '자식 없는 Warning 배지 예제입니다.'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
title: 'badge-no-children-success',
|
|
181
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="success" />`,
|
|
182
|
+
description: '자식 없는 Success 배지 예제입니다.'
|
|
183
|
+
},
|
|
184
|
+
// === Standard badge (with MailIcon) examples ===
|
|
185
|
+
{
|
|
186
|
+
title: 'badge-standard-primary',
|
|
187
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="primary">
|
|
188
|
+
<MailIcon />
|
|
189
|
+
</OpsnowCommonBadge>`,
|
|
190
|
+
description: 'MailIcon이 포함된 Primary 배지 예제입니다.'
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
title: 'badge-standard-error',
|
|
194
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="error">
|
|
195
|
+
<MailIcon />
|
|
196
|
+
</OpsnowCommonBadge>`,
|
|
197
|
+
description: 'MailIcon이 포함된 Error 배지 예제입니다.'
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
title: 'badge-standard-info',
|
|
201
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="info">
|
|
202
|
+
<MailIcon />
|
|
203
|
+
</OpsnowCommonBadge>`,
|
|
204
|
+
description: 'MailIcon이 포함된 Info 배지 예제입니다.'
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
title: 'badge-standard-warning',
|
|
208
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="warning">
|
|
209
|
+
<MailIcon />
|
|
210
|
+
</OpsnowCommonBadge>`,
|
|
211
|
+
description: 'MailIcon이 포함된 Warning 배지 예제입니다.'
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
title: 'badge-standard-success',
|
|
215
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="success">
|
|
216
|
+
<MailIcon />
|
|
217
|
+
</OpsnowCommonBadge>`,
|
|
218
|
+
description: 'MailIcon이 포함된 Success 배지 예제입니다.'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
title: 'badge-standard-show-zero',
|
|
222
|
+
code: `<OpsnowCommonBadge badgeContent={0} color="success" showZero>
|
|
223
|
+
<MailIcon />
|
|
224
|
+
</OpsnowCommonBadge>`,
|
|
225
|
+
description: '0 값을 표시하는 ShowZero 옵션이 적용된 배지 예제입니다.'
|
|
226
|
+
},
|
|
227
|
+
// === Dot badge (with MailIcon) examples ===
|
|
228
|
+
{
|
|
229
|
+
title: 'badge-dot-primary',
|
|
230
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="primary" variant="dot">
|
|
231
|
+
<MailIcon />
|
|
232
|
+
</OpsnowCommonBadge>`,
|
|
233
|
+
description: 'MailIcon이 포함된 Primary Dot 배지 예제입니다.'
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
title: 'badge-dot-error',
|
|
237
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="error" variant="dot">
|
|
238
|
+
<MailIcon />
|
|
239
|
+
</OpsnowCommonBadge>`,
|
|
240
|
+
description: 'MailIcon이 포함된 Error Dot 배지 예제입니다.'
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
title: 'badge-dot-info',
|
|
244
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="info" variant="dot">
|
|
245
|
+
<MailIcon />
|
|
246
|
+
</OpsnowCommonBadge>`,
|
|
247
|
+
description: 'MailIcon이 포함된 Info Dot 배지 예제입니다.'
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
title: 'badge-dot-warning',
|
|
251
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="warning" variant="dot">
|
|
252
|
+
<MailIcon />
|
|
253
|
+
</OpsnowCommonBadge>`,
|
|
254
|
+
description: 'MailIcon이 포함된 Warning Dot 배지 예제입니다.'
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
title: 'badge-dot-success',
|
|
258
|
+
code: `<OpsnowCommonBadge badgeContent={4} color="success" variant="dot">
|
|
259
|
+
<MailIcon />
|
|
260
|
+
</OpsnowCommonBadge>`,
|
|
261
|
+
description: 'MailIcon이 포함된 Success Dot 배지 예제입니다.'
|
|
262
|
+
}
|
|
263
|
+
];
|
|
264
|
+
export const TextareaExamples = [
|
|
265
|
+
{
|
|
266
|
+
title: 'outlined-variant-default',
|
|
267
|
+
code: `<OpsnowCommonTextarea
|
|
268
|
+
placeholder="Outlined variant textarea"
|
|
269
|
+
value={textOutlined}
|
|
270
|
+
onChange={(e) => setTextOutlined(e.target.value)}
|
|
271
|
+
variant="outlined"
|
|
272
|
+
/>`,
|
|
273
|
+
description: 'Outlined Variant (default) 예제입니다.'
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
title: 'standard-variant',
|
|
277
|
+
code: `<OpsnowCommonTextarea
|
|
278
|
+
placeholder="Standard variant textarea"
|
|
279
|
+
value={textStandard}
|
|
280
|
+
onChange={(e) => setTextStandard(e.target.value)}
|
|
281
|
+
variant="standard"
|
|
282
|
+
/>`,
|
|
283
|
+
description: 'Standard Variant 예제입니다.'
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
title: 'filled-variant',
|
|
287
|
+
code: `<OpsnowCommonTextarea
|
|
288
|
+
placeholder="Filled variant textarea"
|
|
289
|
+
value={textFilled}
|
|
290
|
+
onChange={(e) => setTextFilled(e.target.value)}
|
|
291
|
+
variant="filled"
|
|
292
|
+
/>`,
|
|
293
|
+
description: 'Filled Variant 예제입니다.'
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
title: 'fixed-height-rows-10',
|
|
297
|
+
code: `<OpsnowCommonTextarea
|
|
298
|
+
placeholder="Fixed height textarea"
|
|
299
|
+
value={textFixed}
|
|
300
|
+
onChange={(e) => setTextFixed(e.target.value)}
|
|
301
|
+
rows={10}
|
|
302
|
+
/>`,
|
|
303
|
+
description: 'Fixed Height (rows=10) 예제입니다.'
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
title: 'auto-resize',
|
|
307
|
+
code: `<OpsnowCommonTextarea
|
|
308
|
+
placeholder="Auto resize textarea"
|
|
309
|
+
autoSize
|
|
310
|
+
value={textAuto}
|
|
311
|
+
onChange={(e) => setTextAuto(e.target.value)}
|
|
312
|
+
/>`,
|
|
313
|
+
description: 'Auto Resize 예제입니다.'
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
title: 'with-helper-text',
|
|
317
|
+
code: `<OpsnowCommonTextarea
|
|
318
|
+
placeholder="Textarea with helper text"
|
|
319
|
+
value={textHelper}
|
|
320
|
+
onChange={(e) => setTextHelper(e.target.value)}
|
|
321
|
+
helperText="Helper text goes here"
|
|
322
|
+
/>`,
|
|
323
|
+
description: 'With Helper Text 예제입니다.'
|
|
324
|
+
}
|
|
325
|
+
];
|
|
326
|
+
export const SwitchExamples = [
|
|
327
|
+
{
|
|
328
|
+
title: 'default-switch',
|
|
329
|
+
code: `<OpsnowCommonSwitch
|
|
330
|
+
checked={switchStates.default}
|
|
331
|
+
onChange={handleToggle('default')}
|
|
332
|
+
/>`,
|
|
333
|
+
description: 'Default Switch 예제입니다.'
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
title: 'default-switch-small',
|
|
337
|
+
code: `<OpsnowCommonSwitch
|
|
338
|
+
size="small"
|
|
339
|
+
checked={switchStates.default}
|
|
340
|
+
onChange={handleToggle('default')}
|
|
341
|
+
/>`,
|
|
342
|
+
description: 'Default Switch (small) 예제입니다.'
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
title: 'disabled-default-switch',
|
|
346
|
+
code: `<OpsnowCommonSwitch
|
|
347
|
+
checked={switchStates.default}
|
|
348
|
+
onChange={handleToggle('default')}
|
|
349
|
+
disabled
|
|
350
|
+
/>`,
|
|
351
|
+
description: 'Disabled Default Switch 예제입니다.'
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
title: 'primary-switch',
|
|
355
|
+
code: `<OpsnowCommonSwitch
|
|
356
|
+
checked={switchStates.primary}
|
|
357
|
+
onChange={handleToggle('primary')}
|
|
358
|
+
color="primary"
|
|
359
|
+
/>`,
|
|
360
|
+
description: 'Primary Switch 예제입니다.'
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
title: 'secondary-switch',
|
|
364
|
+
code: `<OpsnowCommonSwitch
|
|
365
|
+
checked={switchStates.secondary}
|
|
366
|
+
onChange={handleToggle('secondary')}
|
|
367
|
+
color="secondary"
|
|
368
|
+
/>`,
|
|
369
|
+
description: 'Secondary Switch 예제입니다.'
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
title: 'error-switch',
|
|
373
|
+
code: `<OpsnowCommonSwitch
|
|
374
|
+
checked={switchStates.error}
|
|
375
|
+
onChange={handleToggle('error')}
|
|
376
|
+
color="error"
|
|
377
|
+
/>`,
|
|
378
|
+
description: 'Error Switch 예제입니다.'
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
title: 'warning-switch',
|
|
382
|
+
code: `<OpsnowCommonSwitch
|
|
383
|
+
checked={switchStates.warning}
|
|
384
|
+
onChange={handleToggle('warning')}
|
|
385
|
+
color="warning"
|
|
386
|
+
/>`,
|
|
387
|
+
description: 'Warning Switch 예제입니다.'
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
title: 'info-switch',
|
|
391
|
+
code: `<OpsnowCommonSwitch
|
|
392
|
+
checked={switchStates.info}
|
|
393
|
+
onChange={handleToggle('info')}
|
|
394
|
+
color="info"
|
|
395
|
+
/>`,
|
|
396
|
+
description: 'Info Switch 예제입니다.'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
title: 'success-switch',
|
|
400
|
+
code: `<OpsnowCommonSwitch
|
|
401
|
+
checked={switchStates.success}
|
|
402
|
+
onChange={handleToggle('success')}
|
|
403
|
+
color="success"
|
|
404
|
+
/>`,
|
|
405
|
+
description: 'Success Switch 예제입니다.'
|
|
406
|
+
}
|
|
407
|
+
];
|
|
408
|
+
export const ChipExamples = [
|
|
409
|
+
{
|
|
410
|
+
title: 'default-chip-with-avatar-click-delete',
|
|
411
|
+
code: `<OpsnowCommonChip
|
|
412
|
+
label="Primary"
|
|
413
|
+
color="default"
|
|
414
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
415
|
+
onClick={handleClickChip}
|
|
416
|
+
onDelete={handleDeleteCip}
|
|
417
|
+
avatar={<Avatar>OP</Avatar>}
|
|
418
|
+
/>`,
|
|
419
|
+
description: 'Default Chips #1: avatar, click, delete 예제입니다.'
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
title: 'default-chip-with-avatar-click',
|
|
423
|
+
code: `<OpsnowCommonChip
|
|
424
|
+
label="Default"
|
|
425
|
+
color="default"
|
|
426
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
427
|
+
onClick={handleClickChip}
|
|
428
|
+
avatar={<Avatar>OP</Avatar>}
|
|
429
|
+
/>`,
|
|
430
|
+
description: 'Default Chips #2: avatar와 click 예제입니다.'
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
title: 'default-chip-basic',
|
|
434
|
+
code: `<OpsnowCommonChip
|
|
435
|
+
label="Default"
|
|
436
|
+
color="default"
|
|
437
|
+
/>`,
|
|
438
|
+
description: 'Default Chips #3: 기본 예제입니다.'
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
title: 'default-chip-deletable',
|
|
442
|
+
code: `<OpsnowCommonChip
|
|
443
|
+
label="Default"
|
|
444
|
+
color="default"
|
|
445
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
446
|
+
onDelete={handleDeleteCip}
|
|
447
|
+
/>`,
|
|
448
|
+
description: 'Default Chips #4: deleteOnly 예제입니다.'
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
title: 'default-chip-disabled',
|
|
452
|
+
code: `<OpsnowCommonChip
|
|
453
|
+
label="Default"
|
|
454
|
+
color="default"
|
|
455
|
+
disabled
|
|
456
|
+
/>`,
|
|
457
|
+
description: 'Default Chips #5: disabled 예제입니다.'
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
title: 'default-chip-small-with-avatar-click-delete',
|
|
461
|
+
code: `<OpsnowCommonChip
|
|
462
|
+
label="Default"
|
|
463
|
+
color="default"
|
|
464
|
+
size="small"
|
|
465
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
466
|
+
onClick={handleClickChip}
|
|
467
|
+
avatar={<Avatar>OP</Avatar>}
|
|
468
|
+
/>`,
|
|
469
|
+
description: 'Default Chips #6 (small): avatar, click, delete 예제입니다.'
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
title: 'default-chip-small-basic',
|
|
473
|
+
code: `<OpsnowCommonChip
|
|
474
|
+
label="Default"
|
|
475
|
+
color="default"
|
|
476
|
+
size="small"
|
|
477
|
+
/>`,
|
|
478
|
+
description: 'Default Chips #7 (small): 기본 예제입니다.'
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
title: 'default-chip-small-deletable',
|
|
482
|
+
code: `<OpsnowCommonChip
|
|
483
|
+
label="Default"
|
|
484
|
+
color="default"
|
|
485
|
+
size="small"
|
|
486
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
487
|
+
onDelete={handleDeleteCip}
|
|
488
|
+
/>`,
|
|
489
|
+
description: 'Default Chips #8 (small): deleteOnly 예제입니다.'
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
title: 'outlined-chip-with-avatar-click-delete',
|
|
493
|
+
code: `<OpsnowCommonChip
|
|
494
|
+
label="Default"
|
|
495
|
+
color="default"
|
|
496
|
+
variant="outlined"
|
|
497
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
498
|
+
onClick={handleClickChip}
|
|
499
|
+
avatar={<Avatar>OP</Avatar>}
|
|
500
|
+
/>`,
|
|
501
|
+
description: 'Outlined Variant #1: avatar, click, delete 예제입니다.'
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
title: 'outlined-chip-basic',
|
|
505
|
+
code: `<OpsnowCommonChip
|
|
506
|
+
label="Default"
|
|
507
|
+
color="default"
|
|
508
|
+
variant="outlined"
|
|
509
|
+
/>`,
|
|
510
|
+
description: 'Outlined Variant #2: 기본 예제입니다.'
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
title: 'outlined-chip-deletable',
|
|
514
|
+
code: `<OpsnowCommonChip
|
|
515
|
+
label="Default"
|
|
516
|
+
color="default"
|
|
517
|
+
variant="outlined"
|
|
518
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
519
|
+
onDelete={handleDeleteCip}
|
|
520
|
+
/>`,
|
|
521
|
+
description: 'Outlined Variant #3: deleteOnly 예제입니다.'
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
title: 'outlined-chip-disabled',
|
|
525
|
+
code: `<OpsnowCommonChip
|
|
526
|
+
label="Default"
|
|
527
|
+
color="default"
|
|
528
|
+
variant="outlined"
|
|
529
|
+
disabled
|
|
530
|
+
/>`,
|
|
531
|
+
description: 'Outlined Variant #4: disabled 예제입니다.'
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
title: 'outlined-chip-small-with-avatar-click',
|
|
535
|
+
code: `<OpsnowCommonChip
|
|
536
|
+
label="Default"
|
|
537
|
+
color="default"
|
|
538
|
+
variant="outlined"
|
|
539
|
+
size="small"
|
|
540
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
541
|
+
onClick={handleClickChip}
|
|
542
|
+
avatar={<Avatar>OP</Avatar>}
|
|
543
|
+
/>`,
|
|
544
|
+
description: 'Outlined Variant #5 (small): avatar, click 예제입니다.'
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
title: 'outlined-chip-small-basic',
|
|
548
|
+
code: `<OpsnowCommonChip
|
|
549
|
+
label="Default"
|
|
550
|
+
color="default"
|
|
551
|
+
variant="outlined"
|
|
552
|
+
size="small"
|
|
553
|
+
/>`,
|
|
554
|
+
description: 'Outlined Variant #6 (small): 기본 예제입니다.'
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
title: 'outlined-chip-small-deletable',
|
|
558
|
+
code: `<OpsnowCommonChip
|
|
559
|
+
label="Default"
|
|
560
|
+
color="default"
|
|
561
|
+
variant="outlined"
|
|
562
|
+
size="small"
|
|
563
|
+
deleteIcon={<OpsnowCommonIcon size={18} iconName="CloseSm" />}
|
|
564
|
+
onDelete={handleDeleteCip}
|
|
565
|
+
/>`,
|
|
566
|
+
description: 'Outlined Variant #7 (small): deleteOnly 예제입니다.'
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
title: 'outlined-chip-small-disabled',
|
|
570
|
+
code: `<OpsnowCommonChip
|
|
571
|
+
label="Default"
|
|
572
|
+
color="default"
|
|
573
|
+
variant="outlined"
|
|
574
|
+
size="small"
|
|
575
|
+
disabled
|
|
576
|
+
/>`,
|
|
577
|
+
description: 'Outlined Variant #8 (small): disabled 예제입니다.'
|
|
578
|
+
}
|
|
579
|
+
];
|
|
580
|
+
export const TextFieldExamples = [
|
|
581
|
+
// 1) Basic TextFields
|
|
582
|
+
{
|
|
583
|
+
title: 'basic-standard-name',
|
|
584
|
+
code: `<OpsnowCommonTextField
|
|
585
|
+
placeholder="Enter your name"
|
|
586
|
+
adornmentLabel='less than'
|
|
587
|
+
value={name}
|
|
588
|
+
onChange={(e) => setName(e.target.value)}
|
|
589
|
+
variant="standard"
|
|
590
|
+
/>`,
|
|
591
|
+
description: 'Name (standard) 예제입니다.'
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
title: 'basic-outlined-email',
|
|
595
|
+
code: `<OpsnowCommonTextField
|
|
596
|
+
placeholder="Enter your email"
|
|
597
|
+
value={email}
|
|
598
|
+
adornmentIconName='SearchMagnifier'
|
|
599
|
+
onChange={handleEmailChange}
|
|
600
|
+
helperText={emailHelperText}
|
|
601
|
+
error={!!emailHelperText && emailHelperText !== '이메일을 입력하세요'}
|
|
602
|
+
variant="outlined"
|
|
603
|
+
/>`,
|
|
604
|
+
description: 'Email (outlined) 예제입니다.'
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
title: 'basic-filled-password',
|
|
608
|
+
code: `<OpsnowCommonTextField
|
|
609
|
+
placeholder="Password"
|
|
610
|
+
adornmentLabel='MB/M'
|
|
611
|
+
adornmentPosition='end'
|
|
612
|
+
type="password"
|
|
613
|
+
value={password}
|
|
614
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
615
|
+
variant="filled"
|
|
616
|
+
/>`,
|
|
617
|
+
description: 'Password (filled) 예제입니다.'
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
title: 'basic-outlined-password-preview',
|
|
621
|
+
code: `<OpsnowCommonTextField
|
|
622
|
+
placeholder="비밀번호를 입력하세요"
|
|
623
|
+
variant="outlined"
|
|
624
|
+
type={showPassword ? 'text' : 'password'}
|
|
625
|
+
value={password}
|
|
626
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
627
|
+
InputProps={{
|
|
628
|
+
endAdornment: (
|
|
629
|
+
<InputAdornment position="end">
|
|
630
|
+
<IconButton
|
|
631
|
+
aria-label={showPassword ? '비밀번호 숨기기' : '비밀번호 보이기'}
|
|
632
|
+
onClick={handleToggleShow}
|
|
633
|
+
onMouseDown={handleMouseDown}
|
|
634
|
+
edge="end"
|
|
635
|
+
>
|
|
636
|
+
{showPassword ? <VisibilityOff /> : <Visibility />}
|
|
637
|
+
</IconButton>
|
|
638
|
+
</InputAdornment>
|
|
639
|
+
),
|
|
640
|
+
}}
|
|
641
|
+
/>`,
|
|
642
|
+
description: 'Password 미리보기 (outlined) 예제입니다.'
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
title: 'basic-outlined-readonly',
|
|
646
|
+
code: `<OpsnowCommonTextField
|
|
647
|
+
placeholder="Read Only"
|
|
648
|
+
value="Read only text"
|
|
649
|
+
inputProps={{ readOnly: true }}
|
|
650
|
+
variant="outlined"
|
|
651
|
+
/>`,
|
|
652
|
+
description: 'Read Only (outlined) 예제입니다.'
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
title: 'basic-standard-number-only',
|
|
656
|
+
code: `<OpsnowCommonTextField
|
|
657
|
+
placeholder="Enter numbers only"
|
|
658
|
+
variant="standard"
|
|
659
|
+
type="number"
|
|
660
|
+
value={number}
|
|
661
|
+
onChange={(e) => setNumber(e.target.value.replace(/[^0-9]/g, ''))}
|
|
662
|
+
inputProps={{ inputMode: 'numeric', pattern: '[0-9]*' }}
|
|
663
|
+
/>`,
|
|
664
|
+
description: 'Number Only (standard) 예제입니다.'
|
|
665
|
+
},
|
|
666
|
+
// 2) Error States
|
|
667
|
+
{
|
|
668
|
+
title: 'error-filled',
|
|
669
|
+
code: `<OpsnowCommonTextField
|
|
670
|
+
placeholder="Email"
|
|
671
|
+
error
|
|
672
|
+
variant="filled"
|
|
673
|
+
/>`,
|
|
674
|
+
description: 'Filled Error 예제입니다.'
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
title: 'error-outlined',
|
|
678
|
+
code: `<OpsnowCommonTextField
|
|
679
|
+
placeholder="Password"
|
|
680
|
+
type="password"
|
|
681
|
+
error
|
|
682
|
+
variant="outlined"
|
|
683
|
+
/>`,
|
|
684
|
+
description: 'Outlined Error 예제입니다.'
|
|
685
|
+
},
|
|
686
|
+
// 3) Disabled States
|
|
687
|
+
{
|
|
688
|
+
title: 'disabled-standard',
|
|
689
|
+
code: `<OpsnowCommonTextField
|
|
690
|
+
placeholder="Disabled Input"
|
|
691
|
+
variant="standard"
|
|
692
|
+
disabled
|
|
693
|
+
/>`,
|
|
694
|
+
description: 'Standard Disabled 예제입니다.'
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
title: 'disabled-outlined',
|
|
698
|
+
code: `<OpsnowCommonTextField
|
|
699
|
+
placeholder="Disabled Input"
|
|
700
|
+
disabled
|
|
701
|
+
variant="outlined"
|
|
702
|
+
/>`,
|
|
703
|
+
description: 'Outlined Disabled 예제입니다.'
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
title: 'disabled-filled',
|
|
707
|
+
code: `<OpsnowCommonTextField
|
|
708
|
+
placeholder="Disabled Input"
|
|
709
|
+
disabled
|
|
710
|
+
variant="filled"
|
|
711
|
+
/>`,
|
|
712
|
+
description: 'Filled Disabled 예제입니다.'
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
title: 'disabled-with-value',
|
|
716
|
+
code: `<OpsnowCommonTextField
|
|
717
|
+
placeholder="Disabled with Value"
|
|
718
|
+
value="Can't edit this"
|
|
719
|
+
disabled
|
|
720
|
+
variant="outlined"
|
|
721
|
+
/>`,
|
|
722
|
+
description: 'Disabled with Value 예제입니다.'
|
|
723
|
+
},
|
|
724
|
+
// 4) Additional Variants
|
|
725
|
+
{
|
|
726
|
+
title: 'variant-filled',
|
|
727
|
+
code: `<OpsnowCommonTextField
|
|
728
|
+
placeholder="Filled"
|
|
729
|
+
variant="filled"
|
|
730
|
+
value="Filled variant"
|
|
731
|
+
/>`,
|
|
732
|
+
description: 'Filled 예제입니다.'
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
title: 'variant-outlined',
|
|
736
|
+
code: `<OpsnowCommonTextField
|
|
737
|
+
placeholder="Outlined"
|
|
738
|
+
variant="outlined"
|
|
739
|
+
value="Outlined variant"
|
|
740
|
+
/>`,
|
|
741
|
+
description: 'Outlined 예제입니다.'
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
title: 'variant-medium-standard',
|
|
745
|
+
code: `<OpsnowCommonTextField
|
|
746
|
+
placeholder="Medium Size"
|
|
747
|
+
size="medium"
|
|
748
|
+
variant="standard"
|
|
749
|
+
/>`,
|
|
750
|
+
description: 'Medium (standard) 예제입니다.'
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
title: 'variant-small-outlined',
|
|
754
|
+
code: `<OpsnowCommonTextField
|
|
755
|
+
placeholder="Small Size"
|
|
756
|
+
size="small"
|
|
757
|
+
variant="outlined"
|
|
758
|
+
/>`,
|
|
759
|
+
description: 'Small (outlined) 예제입니다.'
|
|
760
|
+
}
|
|
761
|
+
];
|
|
762
|
+
export const AvatarExamples = [
|
|
763
|
+
// 1) Basic Avatars
|
|
764
|
+
{
|
|
765
|
+
title: 'basic-avatar-no-badge',
|
|
766
|
+
code: `<OpsnowCommonAvatar />`,
|
|
767
|
+
description: 'Basic Avatar (no badge) 예제입니다.'
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
title: 'basic-avatar-with-badge',
|
|
771
|
+
code: `<OpsnowCommonAvatar showBadge />`,
|
|
772
|
+
description: 'Basic Avatar with badge 예제입니다.'
|
|
773
|
+
},
|
|
774
|
+
// 2) Text Avatars
|
|
775
|
+
{
|
|
776
|
+
title: 'text-avatar-xsmall',
|
|
777
|
+
code: `<OpsnowCommonAvatar size="xsmall">홍길동</OpsnowCommonAvatar>`,
|
|
778
|
+
description: 'Text Avatar (xsmall) 예제입니다.'
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
title: 'text-avatar-small',
|
|
782
|
+
code: `<OpsnowCommonAvatar size="small">OpsNow</OpsnowCommonAvatar>`,
|
|
783
|
+
description: 'Text Avatar (small) 예제입니다.'
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
title: 'text-avatar-medium',
|
|
787
|
+
code: `<OpsnowCommonAvatar>옵스나우</OpsnowCommonAvatar>`,
|
|
788
|
+
description: 'Text Avatar (medium) 예제입니다.'
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
title: 'text-avatar-large',
|
|
792
|
+
code: `<OpsnowCommonAvatar size="large">Test Company</OpsnowCommonAvatar>`,
|
|
793
|
+
description: 'Text Avatar (large) 예제입니다.'
|
|
794
|
+
},
|
|
795
|
+
// 3) Avatars with OpsnowCommonIcon
|
|
796
|
+
{
|
|
797
|
+
title: 'icon-avatar-xsmall',
|
|
798
|
+
code: `<OpsnowCommonAvatar size="xsmall"><OpsnowCommonIcon iconName="CloudPlus" /></OpsnowCommonAvatar>`,
|
|
799
|
+
description: 'Avatar with OpsnowCommonIcon (xsmall) 예제입니다.'
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
title: 'icon-avatar-small',
|
|
803
|
+
code: `<OpsnowCommonAvatar size="small"><OpsnowCommonIcon iconName="CloudPlus" /></OpsnowCommonAvatar>`,
|
|
804
|
+
description: 'Avatar with OpsnowCommonIcon (small) 예제입니다.'
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
title: 'icon-avatar-medium',
|
|
808
|
+
code: `<OpsnowCommonAvatar><OpsnowCommonIcon iconName="CloudPlus" /></OpsnowCommonAvatar>`,
|
|
809
|
+
description: 'Avatar with OpsnowCommonIcon (medium) 예제입니다.'
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
title: 'icon-avatar-large',
|
|
813
|
+
code: `<OpsnowCommonAvatar size="large"><OpsnowCommonIcon iconName="CloudPlus" /></OpsnowCommonAvatar>`,
|
|
814
|
+
description: 'Avatar with OpsnowCommonIcon (large) 예제입니다.'
|
|
815
|
+
},
|
|
816
|
+
// 4) Different Variant & Colors
|
|
817
|
+
{
|
|
818
|
+
title: 'variant-avatar-circular-red',
|
|
819
|
+
code: `<OpsnowCommonAvatar
|
|
820
|
+
variant="circular"
|
|
821
|
+
size="medium"
|
|
822
|
+
sx={{ bgcolor: 'red', color: 'white' }}
|
|
823
|
+
>
|
|
824
|
+
홍gildong
|
|
825
|
+
</OpsnowCommonAvatar>`,
|
|
826
|
+
description: 'Circular variant (red) 예제입니다.'
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
title: 'variant-avatar-rounded-green',
|
|
830
|
+
code: `<OpsnowCommonAvatar
|
|
831
|
+
variant="rounded"
|
|
832
|
+
size="medium"
|
|
833
|
+
sx={{ bgcolor: 'green', color: 'white' }}
|
|
834
|
+
>
|
|
835
|
+
OpsNow
|
|
836
|
+
</OpsnowCommonAvatar>`,
|
|
837
|
+
description: 'Rounded variant (green) 예제입니다.'
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
title: 'variant-avatar-square-blue',
|
|
841
|
+
code: `<OpsnowCommonAvatar
|
|
842
|
+
variant="square"
|
|
843
|
+
size="medium"
|
|
844
|
+
sx={{ bgcolor: 'blue', color: 'white' }}
|
|
845
|
+
>
|
|
846
|
+
T스트
|
|
847
|
+
</OpsnowCommonAvatar>`,
|
|
848
|
+
description: 'Square variant (blue) 예제입니다.'
|
|
849
|
+
},
|
|
850
|
+
// 5) Avatar with Image
|
|
851
|
+
{
|
|
852
|
+
title: 'image-avatar-sample',
|
|
853
|
+
code: `<OpsnowCommonAvatar alt="Sample Avatar" src={sampleImageUrl} />`,
|
|
854
|
+
description: 'Avatar with image 예제입니다.'
|
|
855
|
+
},
|
|
856
|
+
// 6) Various Sizes
|
|
857
|
+
{
|
|
858
|
+
title: 'image-avatar-xsmall',
|
|
859
|
+
code: `<OpsnowCommonAvatar alt="xsmall Avatar" src={sampleImageUrl} size="xsmall" />`,
|
|
860
|
+
description: 'Image Avatar (xsmall) 예제입니다.'
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
title: 'image-avatar-small',
|
|
864
|
+
code: `<OpsnowCommonAvatar alt="small Avatar" src={sampleImageUrl} size="small" />`,
|
|
865
|
+
description: 'Image Avatar (small) 예제입니다.'
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
title: 'image-avatar-medium',
|
|
869
|
+
code: `<OpsnowCommonAvatar alt="medium Avatar" src={sampleImageUrl} size="medium" />`,
|
|
870
|
+
description: 'Image Avatar (medium) 예제입니다.'
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
title: 'image-avatar-large',
|
|
874
|
+
code: `<OpsnowCommonAvatar alt="large Avatar" src={sampleImageUrl} size="large" />`,
|
|
875
|
+
description: 'Image Avatar (large) 예제입니다.'
|
|
876
|
+
},
|
|
877
|
+
// 7) Clickable Avatar
|
|
878
|
+
{
|
|
879
|
+
title: 'clickable-avatar',
|
|
880
|
+
code: `<OpsnowCommonAvatar
|
|
881
|
+
alt="Clickable Avatar"
|
|
882
|
+
src={sampleImageUrl}
|
|
883
|
+
onClick={() => { alert('Avatar clicked!') }}
|
|
884
|
+
/>`,
|
|
885
|
+
description: 'Clickable Avatar 예제입니다.'
|
|
886
|
+
},
|
|
887
|
+
// 8) alt Property
|
|
888
|
+
{
|
|
889
|
+
title: 'avatar-no-exist-image-alt',
|
|
890
|
+
code: `<OpsnowCommonAvatar alt="Digital platform" src={noExistImageUrl} />`,
|
|
891
|
+
description: 'No Exist Image 예제입니다.'
|
|
892
|
+
}
|
|
893
|
+
];
|
|
894
|
+
export const CheckboxExamples = [
|
|
895
|
+
{
|
|
896
|
+
title: 'primary-checkbox-small',
|
|
897
|
+
code: `<OpsnowCommonCheckbox
|
|
898
|
+
color="primary"
|
|
899
|
+
checked={checkboxStates.primary}
|
|
900
|
+
onChange={handleCheckboxChange}
|
|
901
|
+
name="primary"
|
|
902
|
+
label="Primary (Small)"
|
|
903
|
+
size="small"
|
|
904
|
+
/>`,
|
|
905
|
+
description: 'Primary Checkbox (small) 예제입니다.'
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
title: 'primary-checkbox-large',
|
|
909
|
+
code: `<OpsnowCommonCheckbox
|
|
910
|
+
color="primary"
|
|
911
|
+
checked={checkboxStates.primary}
|
|
912
|
+
onChange={handleCheckboxChange}
|
|
913
|
+
name="primary"
|
|
914
|
+
label="Primary (large)"
|
|
915
|
+
size="large"
|
|
916
|
+
/>`,
|
|
917
|
+
description: 'Primary Checkbox (large) 예제입니다.'
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
title: 'secondary-checkbox',
|
|
921
|
+
code: `<OpsnowCommonCheckbox
|
|
922
|
+
color="secondary"
|
|
923
|
+
checked={checkboxStates.secondary}
|
|
924
|
+
onChange={handleCheckboxChange}
|
|
925
|
+
name="secondary"
|
|
926
|
+
label="Secondary"
|
|
927
|
+
/>`,
|
|
928
|
+
description: 'Secondary Checkbox 예제입니다.'
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
title: 'error-checkbox',
|
|
932
|
+
code: `<OpsnowCommonCheckbox
|
|
933
|
+
color="error"
|
|
934
|
+
checked={checkboxStates.error}
|
|
935
|
+
onChange={handleCheckboxChange}
|
|
936
|
+
name="error"
|
|
937
|
+
label="Error"
|
|
938
|
+
/>`,
|
|
939
|
+
description: 'Error Checkbox 예제입니다.'
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
title: 'success-checkbox',
|
|
943
|
+
code: `<OpsnowCommonCheckbox
|
|
944
|
+
color="success"
|
|
945
|
+
checked={checkboxStates.success}
|
|
946
|
+
onChange={handleCheckboxChange}
|
|
947
|
+
name="success"
|
|
948
|
+
label="Success"
|
|
949
|
+
/>`,
|
|
950
|
+
description: 'Success Checkbox 예제입니다.'
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
title: 'warning-checkbox',
|
|
954
|
+
code: `<OpsnowCommonCheckbox
|
|
955
|
+
color="warning"
|
|
956
|
+
checked={checkboxStates.warning}
|
|
957
|
+
onChange={handleCheckboxChange}
|
|
958
|
+
name="warning"
|
|
959
|
+
label="Warning"
|
|
960
|
+
/>`,
|
|
961
|
+
description: 'Warning Checkbox 예제입니다.'
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
title: 'info-checkbox',
|
|
965
|
+
code: `<OpsnowCommonCheckbox
|
|
966
|
+
color="info"
|
|
967
|
+
checked={checkboxStates.info}
|
|
968
|
+
onChange={handleCheckboxChange}
|
|
969
|
+
name="info"
|
|
970
|
+
label="Info"
|
|
971
|
+
/>`,
|
|
972
|
+
description: 'Info Checkbox 예제입니다.'
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
title: 'default-checkbox',
|
|
976
|
+
code: `<OpsnowCommonCheckbox
|
|
977
|
+
checked={checkboxStates.default}
|
|
978
|
+
onChange={handleCheckboxChange}
|
|
979
|
+
name="default"
|
|
980
|
+
label="Default"
|
|
981
|
+
/>`,
|
|
982
|
+
description: 'Default Checkbox 예제입니다.'
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
title: 'disabled-checkbox',
|
|
986
|
+
code: `<OpsnowCommonCheckbox
|
|
987
|
+
disabled
|
|
988
|
+
checked={checkboxStates.disabled}
|
|
989
|
+
onChange={handleCheckboxChange}
|
|
990
|
+
name="disabled"
|
|
991
|
+
label="Disabled"
|
|
992
|
+
/>`,
|
|
993
|
+
description: 'Disabled Checkbox 예제입니다.'
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
title: 'parent-checkbox',
|
|
997
|
+
code: `<OpsnowCommonCheckbox
|
|
998
|
+
checked={checkboxStates.parent}
|
|
999
|
+
indeterminate={!checkboxStates.parent && (checkboxStates.child1 || checkboxStates.child2 || checkboxStates.child3)}
|
|
1000
|
+
onChange={handleParentCheckboxChange}
|
|
1001
|
+
name="parent"
|
|
1002
|
+
label="Parent Checkbox"
|
|
1003
|
+
/>`,
|
|
1004
|
+
description: 'Parent Checkbox 예제입니다.'
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
title: 'child1-checkbox',
|
|
1008
|
+
code: `<OpsnowCommonCheckbox
|
|
1009
|
+
checked={checkboxStates.child1}
|
|
1010
|
+
onChange={handleChildCheckboxChange}
|
|
1011
|
+
name="child1"
|
|
1012
|
+
label="Child Checkbox 1"
|
|
1013
|
+
/>`,
|
|
1014
|
+
description: 'Child Checkbox 1 예제입니다.'
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
title: 'child2-checkbox',
|
|
1018
|
+
code: `<OpsnowCommonCheckbox
|
|
1019
|
+
checked={checkboxStates.child2}
|
|
1020
|
+
onChange={handleChildCheckboxChange}
|
|
1021
|
+
name="child2"
|
|
1022
|
+
label="Child Checkbox 2"
|
|
1023
|
+
/>`,
|
|
1024
|
+
description: 'Child Checkbox 2 예제입니다.'
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
title: 'child3-checkbox',
|
|
1028
|
+
code: `<OpsnowCommonCheckbox
|
|
1029
|
+
checked={checkboxStates.child3}
|
|
1030
|
+
onChange={handleChildCheckboxChange}
|
|
1031
|
+
name="child3"
|
|
1032
|
+
label="Child Checkbox 3"
|
|
1033
|
+
/>`,
|
|
1034
|
+
description: 'Child Checkbox 3 예제입니다.'
|
|
1035
|
+
}
|
|
1036
|
+
];
|
|
1037
|
+
export const RadioGroupExamples = [
|
|
1038
|
+
{
|
|
1039
|
+
title: 'primary-radio-group-small',
|
|
1040
|
+
code: `<OpsnowCommonRadioGroup
|
|
1041
|
+
options={options}
|
|
1042
|
+
color="primary"
|
|
1043
|
+
name="radio-buttons-primary"
|
|
1044
|
+
defaultValue="option1"
|
|
1045
|
+
row
|
|
1046
|
+
size="small"
|
|
1047
|
+
/>`,
|
|
1048
|
+
description: 'Primary RadioGroup (small) 예제입니다.'
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
title: 'primary-radio-group-large',
|
|
1052
|
+
code: `<OpsnowCommonRadioGroup
|
|
1053
|
+
options={options}
|
|
1054
|
+
color="primary"
|
|
1055
|
+
name="radio-buttons-primary"
|
|
1056
|
+
defaultValue="option1"
|
|
1057
|
+
row
|
|
1058
|
+
size="large"
|
|
1059
|
+
/>`,
|
|
1060
|
+
description: 'Primary RadioGroup (large) 예제입니다.'
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
title: 'secondary-radio-group',
|
|
1064
|
+
code: `<OpsnowCommonRadioGroup
|
|
1065
|
+
options={options}
|
|
1066
|
+
color="secondary"
|
|
1067
|
+
name="radio-buttons-secondary"
|
|
1068
|
+
defaultValue="option1"
|
|
1069
|
+
row
|
|
1070
|
+
/>`,
|
|
1071
|
+
description: 'Secondary RadioGroup 예제입니다.'
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
title: 'error-radio-group',
|
|
1075
|
+
code: `<OpsnowCommonRadioGroup
|
|
1076
|
+
options={options}
|
|
1077
|
+
color="error"
|
|
1078
|
+
name="radio-buttons-error"
|
|
1079
|
+
defaultValue="option1"
|
|
1080
|
+
row
|
|
1081
|
+
/>`,
|
|
1082
|
+
description: 'Error RadioGroup 예제입니다.'
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
title: 'success-radio-group',
|
|
1086
|
+
code: `<OpsnowCommonRadioGroup
|
|
1087
|
+
options={options}
|
|
1088
|
+
color="success"
|
|
1089
|
+
name="radio-buttons-success"
|
|
1090
|
+
defaultValue="option1"
|
|
1091
|
+
row
|
|
1092
|
+
/>`,
|
|
1093
|
+
description: 'Success RadioGroup 예제입니다.'
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
title: 'warning-radio-group',
|
|
1097
|
+
code: `<OpsnowCommonRadioGroup
|
|
1098
|
+
options={options}
|
|
1099
|
+
color="warning"
|
|
1100
|
+
name="radio-buttons-warning"
|
|
1101
|
+
defaultValue="option1"
|
|
1102
|
+
row
|
|
1103
|
+
/>`,
|
|
1104
|
+
description: 'Warning RadioGroup 예제입니다.'
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
title: 'info-radio-group',
|
|
1108
|
+
code: `<OpsnowCommonRadioGroup
|
|
1109
|
+
options={options}
|
|
1110
|
+
color="info"
|
|
1111
|
+
name="radio-buttons-info"
|
|
1112
|
+
defaultValue="option1"
|
|
1113
|
+
row
|
|
1114
|
+
/>`,
|
|
1115
|
+
description: 'Info RadioGroup 예제입니다.'
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
title: 'default-radio-group',
|
|
1119
|
+
code: `<OpsnowCommonRadioGroup
|
|
1120
|
+
options={options}
|
|
1121
|
+
color="default"
|
|
1122
|
+
name="radio-buttons-default"
|
|
1123
|
+
defaultValue="option1"
|
|
1124
|
+
row
|
|
1125
|
+
/>`,
|
|
1126
|
+
description: 'Default RadioGroup 예제입니다.'
|
|
1127
|
+
}
|
|
1128
|
+
];
|
|
1129
|
+
export const CollapseExamples = [
|
|
1130
|
+
{
|
|
1131
|
+
title: 'default-collapse',
|
|
1132
|
+
code: `<OpsnowCommonCollapse
|
|
1133
|
+
label="Toggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle Content"
|
|
1134
|
+
>
|
|
1135
|
+
<div>This is the content inside the collapse component.</div>
|
|
1136
|
+
</OpsnowCommonCollapse>`,
|
|
1137
|
+
description: '기본 Collapse 예제입니다.'
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
title: 'controlled-collapse',
|
|
1141
|
+
code: `<OpsnowCommonCollapse
|
|
1142
|
+
label="Toggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle ContentToggle Content"
|
|
1143
|
+
defaultExpanded
|
|
1144
|
+
>
|
|
1145
|
+
<div>This is the content inside the collapse component.</div>
|
|
1146
|
+
</OpsnowCommonCollapse>`,
|
|
1147
|
+
description: 'defaultExpanded 속성이 설정된 Collapse 예제입니다.'
|
|
1148
|
+
}
|
|
1149
|
+
];
|
|
1150
|
+
export const SliderExamples = [
|
|
1151
|
+
// 1) Continuous Sliders
|
|
1152
|
+
{
|
|
1153
|
+
title: 'continuous-slider-primary-medium',
|
|
1154
|
+
code: `<OpsnowCommonSlider defaultValue={30} color="primary" size="medium" />`,
|
|
1155
|
+
description: 'Continuous Slider (primary, medium) 예제입니다.'
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
title: 'continuous-slider-secondary-small',
|
|
1159
|
+
code: `<OpsnowCommonSlider defaultValue={50} color="secondary" size="small" />`,
|
|
1160
|
+
description: 'Continuous Slider (secondary, small) 예제입니다.'
|
|
1161
|
+
},
|
|
1162
|
+
// 2) Discrete Sliders
|
|
1163
|
+
{
|
|
1164
|
+
title: 'discrete-slider-primary-medium',
|
|
1165
|
+
code: `<OpsnowCommonSlider
|
|
1166
|
+
defaultValue={30}
|
|
1167
|
+
color="primary"
|
|
1168
|
+
size="medium"
|
|
1169
|
+
step={10}
|
|
1170
|
+
marks
|
|
1171
|
+
valueLabelDisplay="auto"
|
|
1172
|
+
/>`,
|
|
1173
|
+
description: 'Discrete Slider (primary, medium) 예제입니다.'
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
title: 'discrete-slider-secondary-small',
|
|
1177
|
+
code: `<OpsnowCommonSlider
|
|
1178
|
+
defaultValue={50}
|
|
1179
|
+
color="secondary"
|
|
1180
|
+
size="small"
|
|
1181
|
+
step={10}
|
|
1182
|
+
marks
|
|
1183
|
+
valueLabelDisplay="auto"
|
|
1184
|
+
/>`,
|
|
1185
|
+
description: 'Discrete Slider (secondary, small) 예제입니다.'
|
|
1186
|
+
},
|
|
1187
|
+
// 3) Range Sliders
|
|
1188
|
+
{
|
|
1189
|
+
title: 'range-slider-primary-medium',
|
|
1190
|
+
code: `<OpsnowCommonSlider defaultValue={[20, 60]} color="primary" size="medium" />`,
|
|
1191
|
+
description: 'Range Slider (primary, medium) 예제입니다.'
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
title: 'range-slider-secondary-small',
|
|
1195
|
+
code: `<OpsnowCommonSlider defaultValue={[30, 70]} color="secondary" size="small" />`,
|
|
1196
|
+
description: 'Range Slider (secondary, small) 예제입니다.'
|
|
1197
|
+
},
|
|
1198
|
+
// 4) Disabled Slider
|
|
1199
|
+
{
|
|
1200
|
+
title: 'disabled-continuous-slider',
|
|
1201
|
+
code: `<OpsnowCommonSlider
|
|
1202
|
+
defaultValue={30}
|
|
1203
|
+
color="primary"
|
|
1204
|
+
size="medium"
|
|
1205
|
+
disabled
|
|
1206
|
+
/>`,
|
|
1207
|
+
description: 'Disabled Continuous Slider 예제입니다.'
|
|
1208
|
+
},
|
|
1209
|
+
// 5) Range with Value Labels
|
|
1210
|
+
{
|
|
1211
|
+
title: 'range-slider-with-marks',
|
|
1212
|
+
code: `<OpsnowCommonSlider
|
|
1213
|
+
defaultValue={[80, 220]}
|
|
1214
|
+
color="primary"
|
|
1215
|
+
size="medium"
|
|
1216
|
+
valueLabelDisplay="on"
|
|
1217
|
+
marks={marks}
|
|
1218
|
+
min={1}
|
|
1219
|
+
max={300}
|
|
1220
|
+
/>`,
|
|
1221
|
+
description: 'Range Slider with value labels 예제입니다.'
|
|
1222
|
+
},
|
|
1223
|
+
// 6) Custom Marks Slider
|
|
1224
|
+
{
|
|
1225
|
+
title: 'custom-marks-slider',
|
|
1226
|
+
code: `<Box sx={{ width: 300, margin: '0 auto' }}>
|
|
1227
|
+
<OpsnowCommonSlider
|
|
1228
|
+
aria-label="Custom marks"
|
|
1229
|
+
defaultValue={20}
|
|
1230
|
+
getAriaValueText={valuetext}
|
|
1231
|
+
step={10}
|
|
1232
|
+
marks={temperatureMarks}
|
|
1233
|
+
valueLabelDisplay="auto"
|
|
1234
|
+
color="primary"
|
|
1235
|
+
size="medium"
|
|
1236
|
+
/>
|
|
1237
|
+
</Box>`,
|
|
1238
|
+
description: 'Custom Marks Slider 예제입니다.'
|
|
1239
|
+
},
|
|
1240
|
+
// 7) Vertical Sliders
|
|
1241
|
+
{
|
|
1242
|
+
title: 'vertical-slider-default',
|
|
1243
|
+
code: `<OpsnowCommonSlider
|
|
1244
|
+
orientation="vertical"
|
|
1245
|
+
defaultValue={30}
|
|
1246
|
+
color="primary"
|
|
1247
|
+
size="medium"
|
|
1248
|
+
/>`,
|
|
1249
|
+
description: 'Vertical Slider (default) 예제입니다.'
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
title: 'vertical-slider-disabled',
|
|
1253
|
+
code: `<OpsnowCommonSlider
|
|
1254
|
+
orientation="vertical"
|
|
1255
|
+
defaultValue={30}
|
|
1256
|
+
color="primary"
|
|
1257
|
+
size="medium"
|
|
1258
|
+
disabled
|
|
1259
|
+
/>`,
|
|
1260
|
+
description: 'Vertical Slider (disabled) 예제입니다.'
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
title: 'vertical-slider-no-value',
|
|
1264
|
+
code: `<OpsnowCommonSlider
|
|
1265
|
+
orientation="vertical"
|
|
1266
|
+
color="primary"
|
|
1267
|
+
size="medium"
|
|
1268
|
+
/>`,
|
|
1269
|
+
description: 'Vertical Slider (no value) 예제입니다.'
|
|
1270
|
+
}
|
|
1271
|
+
];
|
|
1272
|
+
export const LinkExamples = [
|
|
1273
|
+
{
|
|
1274
|
+
title: 'primary-link-always-underline-click',
|
|
1275
|
+
code: `<OpsnowCommonLink
|
|
1276
|
+
href="#"
|
|
1277
|
+
color="primary"
|
|
1278
|
+
underline="always"
|
|
1279
|
+
onClick={(event) => handleClick(event, 'Primary Link (Always underline)')}
|
|
1280
|
+
>
|
|
1281
|
+
Primary Link (Always underline)
|
|
1282
|
+
</OpsnowCommonLink>`,
|
|
1283
|
+
description: 'Primary Link (Always underline) onClick 예제입니다.'
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
title: 'primary-link-hover-underline-click',
|
|
1287
|
+
code: `<OpsnowCommonLink
|
|
1288
|
+
href="#"
|
|
1289
|
+
color="primary"
|
|
1290
|
+
underline="hover"
|
|
1291
|
+
onClick={(event) => handleClick(event, 'Primary Link (hover)')}
|
|
1292
|
+
>
|
|
1293
|
+
Primary Link (hover)
|
|
1294
|
+
</OpsnowCommonLink>`,
|
|
1295
|
+
description: 'Primary Link (hover) onClick 예제입니다.'
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
title: 'primary-link-no-underline-click',
|
|
1299
|
+
code: `<OpsnowCommonLink
|
|
1300
|
+
href="#"
|
|
1301
|
+
color="primary"
|
|
1302
|
+
underline="none"
|
|
1303
|
+
onClick={(event) => handleClick(event, 'Primary Link (No underline)')}
|
|
1304
|
+
>
|
|
1305
|
+
Primary Link (No underline)
|
|
1306
|
+
</OpsnowCommonLink>`,
|
|
1307
|
+
description: 'Primary Link (No underline) onClick 예제입니다.'
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
title: 'inherit-link-always-underline',
|
|
1311
|
+
code: `<OpsnowCommonLink
|
|
1312
|
+
href="#"
|
|
1313
|
+
color="inherit"
|
|
1314
|
+
underline="always"
|
|
1315
|
+
>
|
|
1316
|
+
Inherit Link (Always underline)
|
|
1317
|
+
</OpsnowCommonLink>`,
|
|
1318
|
+
description: 'Inherit Link (Always underline) 예제입니다.'
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
title: 'inherit-link-hover-underline',
|
|
1322
|
+
code: `<OpsnowCommonLink
|
|
1323
|
+
href="#"
|
|
1324
|
+
color="inherit"
|
|
1325
|
+
underline="hover"
|
|
1326
|
+
>
|
|
1327
|
+
Inherit Link (hover)
|
|
1328
|
+
</OpsnowCommonLink>`,
|
|
1329
|
+
description: 'Inherit Link (hover) 예제입니다.'
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
title: 'inherit-link-no-underline',
|
|
1333
|
+
code: `<OpsnowCommonLink
|
|
1334
|
+
href="#"
|
|
1335
|
+
color="inherit"
|
|
1336
|
+
underline="none"
|
|
1337
|
+
>
|
|
1338
|
+
Inherit Link (No underline)
|
|
1339
|
+
</OpsnowCommonLink>`,
|
|
1340
|
+
description: 'Inherit Link (No underline) 예제입니다.'
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
title: 'focusable-primary-link',
|
|
1344
|
+
code: `<OpsnowCommonLink
|
|
1345
|
+
href="#"
|
|
1346
|
+
color="primary"
|
|
1347
|
+
underline="always"
|
|
1348
|
+
>
|
|
1349
|
+
Focusable Primary Link
|
|
1350
|
+
</OpsnowCommonLink>`,
|
|
1351
|
+
description: 'Focusable Primary Link 예제입니다.'
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
title: 'focusable-inherit-link',
|
|
1355
|
+
code: `<OpsnowCommonLink
|
|
1356
|
+
href="#"
|
|
1357
|
+
color="inherit"
|
|
1358
|
+
underline="none"
|
|
1359
|
+
>
|
|
1360
|
+
Focusable Inherit Link
|
|
1361
|
+
</OpsnowCommonLink>`,
|
|
1362
|
+
description: 'Focusable Inherit Link 예제입니다.'
|
|
1363
|
+
}
|
|
1364
|
+
];
|
|
1365
|
+
export const TreeViewExamples = [
|
|
1366
|
+
{
|
|
1367
|
+
title: 'basic-treeview-with-mui-icons',
|
|
1368
|
+
code: `<OpsnowCommonTreeView
|
|
1369
|
+
data={[
|
|
1370
|
+
{
|
|
1371
|
+
id: 'c1',
|
|
1372
|
+
label: 'Settings',
|
|
1373
|
+
muiIconName: 'settings',
|
|
1374
|
+
children: [
|
|
1375
|
+
{
|
|
1376
|
+
id: 'c11',
|
|
1377
|
+
label: 'Profile',
|
|
1378
|
+
muiIconName: 'person',
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
id: 'c12',
|
|
1382
|
+
label: 'Security',
|
|
1383
|
+
muiIconName: 'lock',
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
id: 'c13',
|
|
1387
|
+
label: 'Notifications',
|
|
1388
|
+
muiIconName: 'notifications',
|
|
1389
|
+
},
|
|
1390
|
+
],
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
id: 'c2',
|
|
1394
|
+
label: 'Help',
|
|
1395
|
+
muiIconName: 'help',
|
|
1396
|
+
children: [
|
|
1397
|
+
{
|
|
1398
|
+
id: 'c21',
|
|
1399
|
+
label: 'Documentation',
|
|
1400
|
+
muiIconName: 'menu_book',
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
id: 'c22',
|
|
1404
|
+
label: 'Support',
|
|
1405
|
+
muiIconName: 'support_agent',
|
|
1406
|
+
},
|
|
1407
|
+
],
|
|
1408
|
+
},
|
|
1409
|
+
]}
|
|
1410
|
+
onNodeClick={handleNodeClick}
|
|
1411
|
+
selectedNodeId={selectedNode?.id}
|
|
1412
|
+
/>`,
|
|
1413
|
+
description: 'Material-UI 아이콘을 사용한 기본 TreeView 예제입니다.'
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
title: 'treeview-no-search-no-total',
|
|
1417
|
+
code: `<OpsnowCommonTreeView
|
|
1418
|
+
data={treeData}
|
|
1419
|
+
searchable={false}
|
|
1420
|
+
showTotal={false}
|
|
1421
|
+
defaultExpandAll={true}
|
|
1422
|
+
onNodeClick={handleNodeClick}
|
|
1423
|
+
selectedNodeId={selectedNode?.id}
|
|
1424
|
+
/>`,
|
|
1425
|
+
description: '검색 기능과 Total 라벨을 숨긴 TreeView 예제입니다.'
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
title: 'treeview-with-total-label',
|
|
1429
|
+
code: `<OpsnowCommonTreeView
|
|
1430
|
+
data={treeData}
|
|
1431
|
+
totalLabel="All Items"
|
|
1432
|
+
totalIconName="FolderOpen"
|
|
1433
|
+
onTotalClick={handleTotalClick}
|
|
1434
|
+
onNodeClick={handleNodeClick}
|
|
1435
|
+
selectedNodeId={selectedNode?.id}
|
|
1436
|
+
/>`,
|
|
1437
|
+
description: 'Total 라벨과 아이콘이 있는 TreeView 예제입니다.'
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
title: 'treeview-with-render-content',
|
|
1441
|
+
code: `<OpsnowCommonTreeView
|
|
1442
|
+
data={treeData}
|
|
1443
|
+
renderRightContent={(node) => (
|
|
1444
|
+
<Chip label={node.count || 0} size="small" />
|
|
1445
|
+
)}
|
|
1446
|
+
onNodeClick={handleNodeClick}
|
|
1447
|
+
selectedNodeId={selectedNode?.id}
|
|
1448
|
+
/>`,
|
|
1449
|
+
description: '각 노드 우측에 커스텀 콘텐츠를 렌더링하는 TreeView 예제입니다.'
|
|
1450
|
+
},
|
|
1451
|
+
{
|
|
1452
|
+
title: 'treeview-expanded-by-default',
|
|
1453
|
+
code: `<OpsnowCommonTreeView
|
|
1454
|
+
data={treeData}
|
|
1455
|
+
defaultExpandAll={true}
|
|
1456
|
+
searchable={true}
|
|
1457
|
+
onNodeClick={handleNodeClick}
|
|
1458
|
+
selectedNodeId={selectedNode?.id}
|
|
1459
|
+
/>`,
|
|
1460
|
+
description: '기본적으로 모든 노드가 확장된 TreeView 예제입니다.'
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
title: 'treeview-cloud-providers',
|
|
1464
|
+
code: `<OpsnowCommonTreeView
|
|
1465
|
+
data={[
|
|
1466
|
+
{
|
|
1467
|
+
id: 'aws',
|
|
1468
|
+
label: 'AWS',
|
|
1469
|
+
muiIconName: 'cloud',
|
|
1470
|
+
children: [
|
|
1471
|
+
{ id: 'ec2', label: 'EC2', muiIconName: 'storage' },
|
|
1472
|
+
{ id: 's3', label: 'S3', muiIconName: 'folder' },
|
|
1473
|
+
{ id: 'rds', label: 'RDS', muiIconName: 'database' },
|
|
1474
|
+
],
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
id: 'azure',
|
|
1478
|
+
label: 'Azure',
|
|
1479
|
+
muiIconName: 'cloud',
|
|
1480
|
+
children: [
|
|
1481
|
+
{ id: 'vm', label: 'Virtual Machines', muiIconName: 'computer' },
|
|
1482
|
+
{ id: 'blob', label: 'Blob Storage', muiIconName: 'folder' },
|
|
1483
|
+
],
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
id: 'gcp',
|
|
1487
|
+
label: 'GCP',
|
|
1488
|
+
muiIconName: 'cloud',
|
|
1489
|
+
children: [
|
|
1490
|
+
{ id: 'compute', label: 'Compute Engine', muiIconName: 'dns' },
|
|
1491
|
+
{ id: 'gcs', label: 'Cloud Storage', muiIconName: 'cloud_upload' },
|
|
1492
|
+
],
|
|
1493
|
+
},
|
|
1494
|
+
]}
|
|
1495
|
+
totalLabel="All Cloud Providers"
|
|
1496
|
+
searchable={true}
|
|
1497
|
+
onNodeClick={handleNodeClick}
|
|
1498
|
+
selectedNodeId={selectedNode?.id}
|
|
1499
|
+
/>`,
|
|
1500
|
+
description: '클라우드 프로바이더 트리 구조 예제입니다.'
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
title: 'treeview-with-checkbox-multiselect',
|
|
1504
|
+
code: `<OpsnowCommonTreeView
|
|
1505
|
+
data={sampleTreeData}
|
|
1506
|
+
checkboxSelection={true}
|
|
1507
|
+
multiSelect={true}
|
|
1508
|
+
onCheckedItemsChange={handleMultiCheckedItemsChange}
|
|
1509
|
+
defaultCheckedItems={multiCheckedItems}
|
|
1510
|
+
showTotal={true}
|
|
1511
|
+
totalLabel="Total"
|
|
1512
|
+
totalIconName="Building"
|
|
1513
|
+
searchable={false}
|
|
1514
|
+
defaultExpandAll={true}
|
|
1515
|
+
/>`,
|
|
1516
|
+
description: '체크박스와 다중 선택 기능이 있는 TreeView 예제입니다.'
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
title: 'treeview-checkbox-with-custom-content',
|
|
1520
|
+
code: `<OpsnowCommonTreeView
|
|
1521
|
+
data={sampleTreeData}
|
|
1522
|
+
checkboxSelection={true}
|
|
1523
|
+
multiSelect={true}
|
|
1524
|
+
onCheckedItemsChange={handleMultiCheckedItemsChange}
|
|
1525
|
+
defaultCheckedItems={multiCheckedItems}
|
|
1526
|
+
showTotal={true}
|
|
1527
|
+
totalLabel="Total"
|
|
1528
|
+
totalIconName="Building"
|
|
1529
|
+
onTotalClick={handleTotalClick}
|
|
1530
|
+
renderTotalRightContent={() => (
|
|
1531
|
+
<OpsnowCommonChip
|
|
1532
|
+
label={\`\${String(sampleTreeData.length)} BU\`}
|
|
1533
|
+
size="small"
|
|
1534
|
+
sx={{
|
|
1535
|
+
backgroundColor: 'white',
|
|
1536
|
+
border: '1px solid',
|
|
1537
|
+
}}
|
|
1538
|
+
/>
|
|
1539
|
+
)}
|
|
1540
|
+
searchable={false}
|
|
1541
|
+
defaultExpandAll={true}
|
|
1542
|
+
renderRightContent={(node) => (
|
|
1543
|
+
<OpsnowCommonChip
|
|
1544
|
+
label={
|
|
1545
|
+
node.children && node.children.length > 0
|
|
1546
|
+
? \`\${String(node.children.length)} Teams\`
|
|
1547
|
+
: String(node.data?.memberCount ?? '0')
|
|
1548
|
+
}
|
|
1549
|
+
size="small"
|
|
1550
|
+
sx={{
|
|
1551
|
+
backgroundColor: 'white',
|
|
1552
|
+
border: '1px solid',
|
|
1553
|
+
}}
|
|
1554
|
+
/>
|
|
1555
|
+
)}
|
|
1556
|
+
/>`,
|
|
1557
|
+
description: '체크박스, 커스텀 콘텐츠, Chip이 함께 사용된 TreeView 예제입니다.'
|
|
1558
|
+
}
|
|
1559
|
+
];
|
|
1560
|
+
export const InsightCardExamples = [
|
|
1561
|
+
{
|
|
1562
|
+
title: 'basic-insight-card-with-loading',
|
|
1563
|
+
code: `<Box sx={{ mt: 2 }}><OpsnowCommonInsightCard loading={loading} loadingStage={loadingStage} insightText={insightText} title="Opsnow Insight AI" subtitle="AI-powered cost analysis and recommendations" /></Box>`,
|
|
1564
|
+
description: '로딩 상태와 AI insight 텍스트를 표시하는 InsightCard (타일 형태) 예제입니다.'
|
|
1565
|
+
}
|
|
1566
|
+
];
|
|
1567
|
+
export const InsightContentExamples = [
|
|
1568
|
+
{
|
|
1569
|
+
title: 'basic-insight-content',
|
|
1570
|
+
code: `<OpsnowCommonInsightContent
|
|
1571
|
+
loading={loading}
|
|
1572
|
+
loadingStage={loadingStage}
|
|
1573
|
+
insightText={insightText}
|
|
1574
|
+
collapsed={false}
|
|
1575
|
+
/>`,
|
|
1576
|
+
description: '타일 없이 AI insight 콘텐츠만 표시하는 InsightContent 예제입니다.'
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
title: 'popup-content-rtf-download',
|
|
1580
|
+
code: `// useCommonComponents에서 downloadInsightAsRtf 가져오기
|
|
1581
|
+
const { OpsnowCommonInsightContent, OpsnowCommonPopup, downloadInsightAsRtf } = useCommonComponents()
|
|
1582
|
+
|
|
1583
|
+
// downloadInsightAsRtf 유틸리티로 RTF 파일 다운로드
|
|
1584
|
+
const handleDownload = useCallback(() => {
|
|
1585
|
+
downloadInsightAsRtf({
|
|
1586
|
+
text: popupInsightText,
|
|
1587
|
+
title: 'AI_Insight',
|
|
1588
|
+
})
|
|
1589
|
+
}, [downloadInsightAsRtf, popupInsightText])
|
|
1590
|
+
|
|
1591
|
+
<OpsnowCommonPopup
|
|
1592
|
+
open={popupOpen}
|
|
1593
|
+
onClose={handleClosePopup}
|
|
1594
|
+
title="AI Insight"
|
|
1595
|
+
size="md"
|
|
1596
|
+
>
|
|
1597
|
+
<Box sx={{ maxHeight: '60vh', overflowY: 'auto', padding: '16px' }}>
|
|
1598
|
+
<OpsnowCommonInsightContent
|
|
1599
|
+
loading={popupLoading}
|
|
1600
|
+
loadingStage={popupLoadingStage}
|
|
1601
|
+
insightText={popupInsightText}
|
|
1602
|
+
collapsed={false}
|
|
1603
|
+
emptyMessage="AI 분석 버튼을 클릭하여 인사이트를 생성하세요"
|
|
1604
|
+
/>
|
|
1605
|
+
</Box>
|
|
1606
|
+
</OpsnowCommonPopup>`,
|
|
1607
|
+
description: '팝업에서 텍스트 콘텐츠를 표시하고 RTF 파일로 다운로드하는 예제입니다. downloadInsightAsRtf 유틸리티를 사용하면 어떤 텍스트든 RTF 문서로 내보낼 수 있습니다. [검색 키워드: RTF 다운로드, 콘텐츠 내보내기, 문서 저장, 텍스트 내보내기, 리포트 다운로드]'
|
|
1608
|
+
}
|
|
1609
|
+
];
|
|
1610
|
+
export const ToggleButtonExamples = [
|
|
1611
|
+
{
|
|
1612
|
+
title: 'large-toggle-group',
|
|
1613
|
+
code: `<OpsnowCommonToggleButtonGroup
|
|
1614
|
+
value={alignmentLarge}
|
|
1615
|
+
exclusive
|
|
1616
|
+
onChange={handleAlignmentLarge}
|
|
1617
|
+
size="large"
|
|
1618
|
+
>
|
|
1619
|
+
<OpsnowCommonToggleButton value="left">Left</OpsnowCommonToggleButton>
|
|
1620
|
+
<OpsnowCommonToggleButton value="center">Center</OpsnowCommonToggleButton>
|
|
1621
|
+
<OpsnowCommonToggleButton value="right">Right</OpsnowCommonToggleButton>
|
|
1622
|
+
</OpsnowCommonToggleButtonGroup>`,
|
|
1623
|
+
description: 'Large size toggle button group 예제입니다.'
|
|
1624
|
+
},
|
|
1625
|
+
{
|
|
1626
|
+
title: 'medium-toggle-group',
|
|
1627
|
+
code: `<OpsnowCommonToggleButtonGroup
|
|
1628
|
+
value={alignmentMedium}
|
|
1629
|
+
exclusive
|
|
1630
|
+
onChange={handleAlignmentMedium}
|
|
1631
|
+
size="medium"
|
|
1632
|
+
>
|
|
1633
|
+
<OpsnowCommonToggleButton value="left">Left</OpsnowCommonToggleButton>
|
|
1634
|
+
<OpsnowCommonToggleButton value="center">Center</OpsnowCommonToggleButton>
|
|
1635
|
+
<OpsnowCommonToggleButton value="right">Right</OpsnowCommonToggleButton>
|
|
1636
|
+
</OpsnowCommonToggleButtonGroup>`,
|
|
1637
|
+
description: 'Medium size toggle button group 예제입니다.'
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
title: 'small-toggle-group-icon',
|
|
1641
|
+
code: `<OpsnowCommonToggleButtonGroup
|
|
1642
|
+
value={alignmentSmall}
|
|
1643
|
+
exclusive
|
|
1644
|
+
onChange={handleAlignmentSmall}
|
|
1645
|
+
size="small"
|
|
1646
|
+
>
|
|
1647
|
+
<OpsnowCommonToggleButton value="left">
|
|
1648
|
+
<OpsnowCommonIcon size={16} iconName="SearchMagnifierChart" />
|
|
1649
|
+
Left
|
|
1650
|
+
</OpsnowCommonToggleButton>
|
|
1651
|
+
<OpsnowCommonToggleButton value="center">Center</OpsnowCommonToggleButton>
|
|
1652
|
+
<OpsnowCommonToggleButton value="right">Right</OpsnowCommonToggleButton>
|
|
1653
|
+
</OpsnowCommonToggleButtonGroup>`,
|
|
1654
|
+
description: 'Small size toggle group with icon 예제입니다.'
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
title: 'medium-icon-text-theme-new',
|
|
1658
|
+
code: `<OpsnowCommonToggleButtonGroup
|
|
1659
|
+
value={iconAlignmentMedium}
|
|
1660
|
+
exclusive
|
|
1661
|
+
theme="new"
|
|
1662
|
+
onChange={handleIconAlignmentMedium}
|
|
1663
|
+
size="medium"
|
|
1664
|
+
>
|
|
1665
|
+
<OpsnowCommonToggleButton value="aws">
|
|
1666
|
+
<OpsnowCommonIcon size={16} iconName="LogoAws" />
|
|
1667
|
+
AWS
|
|
1668
|
+
</OpsnowCommonToggleButton>
|
|
1669
|
+
<OpsnowCommonToggleButton value="azure">
|
|
1670
|
+
<OpsnowCommonIcon size={16} iconName="LogoAzure" />
|
|
1671
|
+
Azure
|
|
1672
|
+
</OpsnowCommonToggleButton>
|
|
1673
|
+
<OpsnowCommonToggleButton value="gcp">
|
|
1674
|
+
<OpsnowCommonIcon size={16} iconName="LogoGcp" />
|
|
1675
|
+
GCP
|
|
1676
|
+
</OpsnowCommonToggleButton>
|
|
1677
|
+
</OpsnowCommonToggleButtonGroup>`,
|
|
1678
|
+
description: 'Medium size icon + text (theme="new") 예제입니다.'
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
title: 'medium-icon-only',
|
|
1682
|
+
code: `<OpsnowCommonToggleButtonGroup
|
|
1683
|
+
value={iconAlignmentMedium}
|
|
1684
|
+
exclusive
|
|
1685
|
+
onChange={handleIconAlignmentMedium}
|
|
1686
|
+
size="medium"
|
|
1687
|
+
>
|
|
1688
|
+
<OpsnowCommonToggleButton value="aws">
|
|
1689
|
+
<OpsnowCommonIcon size={16} iconName="LogoAws" />
|
|
1690
|
+
</OpsnowCommonToggleButton>
|
|
1691
|
+
<OpsnowCommonToggleButton value="azure">
|
|
1692
|
+
<OpsnowCommonIcon size={16} iconName="LogoAzure" />
|
|
1693
|
+
</OpsnowCommonToggleButton>
|
|
1694
|
+
<OpsnowCommonToggleButton value="gcp">
|
|
1695
|
+
<OpsnowCommonIcon size={16} iconName="LogoGcp" />
|
|
1696
|
+
</OpsnowCommonToggleButton>
|
|
1697
|
+
</OpsnowCommonToggleButtonGroup>`,
|
|
1698
|
+
description: 'Medium size icon only toggle buttons 예제입니다.'
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
title: 'medium-disabled-toggle-group',
|
|
1702
|
+
code: `<OpsnowCommonToggleButtonGroup
|
|
1703
|
+
value={disabledAlignment}
|
|
1704
|
+
exclusive
|
|
1705
|
+
onChange={handleDisabledAlignment}
|
|
1706
|
+
size="medium"
|
|
1707
|
+
disabled
|
|
1708
|
+
>
|
|
1709
|
+
<OpsnowCommonToggleButton value="left">Left</OpsnowCommonToggleButton>
|
|
1710
|
+
<OpsnowCommonToggleButton value="center">Center</OpsnowCommonToggleButton>
|
|
1711
|
+
<OpsnowCommonToggleButton value="right">Right</OpsnowCommonToggleButton>
|
|
1712
|
+
</OpsnowCommonToggleButtonGroup>`,
|
|
1713
|
+
description: 'Medium size disabled toggle button group 예제입니다.'
|
|
1714
|
+
}
|
|
1715
|
+
];
|