sh-ui-cli 0.46.0 → 0.48.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.
Files changed (85) hide show
  1. package/data/changelog/versions.json +25 -0
  2. package/data/registry/react/components/accordion/index.module.tsx +97 -0
  3. package/data/registry/react/components/accordion/styles.module.css +111 -0
  4. package/data/registry/react/components/avatar/index.module.tsx +73 -0
  5. package/data/registry/react/components/avatar/styles.module.css +36 -0
  6. package/data/registry/react/components/badge/index.module.tsx +40 -0
  7. package/data/registry/react/components/badge/styles.module.css +57 -0
  8. package/data/registry/react/components/breadcrumb/index.module.tsx +152 -0
  9. package/data/registry/react/components/breadcrumb/styles.module.css +82 -0
  10. package/data/registry/react/components/calendar/index.module.tsx +806 -0
  11. package/data/registry/react/components/calendar/styles.module.css +213 -0
  12. package/data/registry/react/components/carousel/index.module.tsx +430 -0
  13. package/data/registry/react/components/carousel/styles.module.css +155 -0
  14. package/data/registry/react/components/checkbox/index.module.tsx +96 -0
  15. package/data/registry/react/components/checkbox/styles.module.css +75 -0
  16. package/data/registry/react/components/code-editor/index.module.tsx +230 -0
  17. package/data/registry/react/components/code-editor/styles.module.css +76 -0
  18. package/data/registry/react/components/code-panel/index.module.tsx +191 -0
  19. package/data/registry/react/components/code-panel/styles.module.css +124 -0
  20. package/data/registry/react/components/color-picker/index.module.tsx +467 -0
  21. package/data/registry/react/components/color-picker/styles.module.css +166 -0
  22. package/data/registry/react/components/combobox/index.module.tsx +165 -0
  23. package/data/registry/react/components/combobox/styles.module.css +151 -0
  24. package/data/registry/react/components/context-menu/index.module.tsx +251 -0
  25. package/data/registry/react/components/context-menu/styles.module.css +140 -0
  26. package/data/registry/react/components/date-picker/index.module.tsx +520 -0
  27. package/data/registry/react/components/date-picker/styles.module.css +103 -0
  28. package/data/registry/react/components/dialog/index.module.tsx +95 -0
  29. package/data/registry/react/components/dialog/styles.module.css +127 -0
  30. package/data/registry/react/components/dropdown-menu/index.module.tsx +255 -0
  31. package/data/registry/react/components/dropdown-menu/styles.module.css +150 -0
  32. package/data/registry/react/components/file-upload/index.module.tsx +487 -0
  33. package/data/registry/react/components/file-upload/styles.module.css +170 -0
  34. package/data/registry/react/components/form/index.module.tsx +61 -0
  35. package/data/registry/react/components/form/styles.module.css +47 -0
  36. package/data/registry/react/components/header/index.module.tsx +805 -0
  37. package/data/registry/react/components/header/styles.module.css +350 -0
  38. package/data/registry/react/components/label/index.module.tsx +52 -0
  39. package/data/registry/react/components/label/styles.module.css +90 -0
  40. package/data/registry/react/components/markdown-editor/index.module.tsx +119 -0
  41. package/data/registry/react/components/markdown-editor/styles.module.css +160 -0
  42. package/data/registry/react/components/menubar/index.module.tsx +32 -0
  43. package/data/registry/react/components/menubar/styles.module.css +45 -0
  44. package/data/registry/react/components/numeric-input/index.module.tsx +148 -0
  45. package/data/registry/react/components/numeric-input/styles.module.css +56 -0
  46. package/data/registry/react/components/page-toc/index.module.tsx +174 -0
  47. package/data/registry/react/components/page-toc/styles.module.css +82 -0
  48. package/data/registry/react/components/pagination/index.module.tsx +269 -0
  49. package/data/registry/react/components/pagination/styles.module.css +105 -0
  50. package/data/registry/react/components/popover/index.module.tsx +113 -0
  51. package/data/registry/react/components/popover/styles.module.css +65 -0
  52. package/data/registry/react/components/progress/index.module.tsx +54 -0
  53. package/data/registry/react/components/progress/styles.module.css +41 -0
  54. package/data/registry/react/components/radio/index.module.tsx +65 -0
  55. package/data/registry/react/components/radio/styles.module.css +80 -0
  56. package/data/registry/react/components/rich-text-editor/index.module.tsx +348 -0
  57. package/data/registry/react/components/rich-text-editor/styles.module.css +196 -0
  58. package/data/registry/react/components/select/index.module.tsx +234 -0
  59. package/data/registry/react/components/select/styles.module.css +193 -0
  60. package/data/registry/react/components/separator/index.module.tsx +46 -0
  61. package/data/registry/react/components/separator/styles.module.css +15 -0
  62. package/data/registry/react/components/sidebar/index.module.tsx +1067 -0
  63. package/data/registry/react/components/sidebar/styles.module.css +502 -0
  64. package/data/registry/react/components/skeleton/index.module.tsx +22 -0
  65. package/data/registry/react/components/skeleton/styles.module.css +24 -0
  66. package/data/registry/react/components/slider/index.module.tsx +298 -0
  67. package/data/registry/react/components/slider/styles.module.css +64 -0
  68. package/data/registry/react/components/spinner/index.module.tsx +38 -0
  69. package/data/registry/react/components/spinner/styles.module.css +37 -0
  70. package/data/registry/react/components/switch/index.module.tsx +39 -0
  71. package/data/registry/react/components/switch/styles.module.css +83 -0
  72. package/data/registry/react/components/tabs/index.module.tsx +91 -0
  73. package/data/registry/react/components/tabs/styles.module.css +148 -0
  74. package/data/registry/react/components/textarea/index.module.tsx +23 -0
  75. package/data/registry/react/components/textarea/styles.module.css +54 -0
  76. package/data/registry/react/components/toast/index.module.tsx +258 -0
  77. package/data/registry/react/components/toast/styles.module.css +290 -0
  78. package/data/registry/react/components/toggle/index.module.tsx +131 -0
  79. package/data/registry/react/components/toggle/styles.module.css +85 -0
  80. package/data/registry/react/components/tooltip/index.module.tsx +83 -0
  81. package/data/registry/react/components/tooltip/styles.module.css +44 -0
  82. package/data/registry/react/registry.json +560 -0
  83. package/package.json +1 -1
  84. package/src/api.d.ts +4 -3
  85. package/src/constants.js +4 -3
@@ -0,0 +1,502 @@
1
+ /* ───────────── Tokens ───────────── */
2
+ .sidebar-wrapper {
3
+ --sidebar-width: 16rem;
4
+ --sidebar-width-icon: 3rem;
5
+ --sidebar-width-mobile: 18rem;
6
+ --sidebar-bg: var(--background-subtle);
7
+ --sidebar-fg: var(--foreground);
8
+ --sidebar-border: var(--border);
9
+ --sidebar-accent: var(--background-muted);
10
+ --sidebar-accent-fg: var(--foreground);
11
+
12
+ display: flex;
13
+ min-height: 100svh;
14
+ width: 100%;
15
+ }
16
+
17
+ /* embedded: 문서 데모용 */
18
+ .sidebar-wrapper[data-embedded] {
19
+ min-height: 0;
20
+ height: 100%;
21
+ }
22
+ .sidebar-wrapper[data-embedded] .sidebar__inner,
23
+ .sidebar-wrapper[data-embedded] .sidebar--static {
24
+ height: 100%;
25
+ position: relative;
26
+ top: 0;
27
+ }
28
+ .sidebar-wrapper[data-embedded] .sidebar--mobile {
29
+ position: absolute;
30
+ }
31
+ .sidebar-wrapper[data-embedded] .sidebar__backdrop {
32
+ position: absolute;
33
+ }
34
+
35
+ /* ───────────── Sidebar (desktop) ───────────── */
36
+ .sidebar {
37
+ display: flex;
38
+ flex-direction: column;
39
+ width: var(--sidebar-width);
40
+ flex-shrink: 0;
41
+ background: var(--sidebar-bg);
42
+ color: var(--sidebar-fg);
43
+ border-right: 1px solid var(--sidebar-border);
44
+ transition: width var(--duration-slow) ease;
45
+ position: relative;
46
+ z-index: 5;
47
+ }
48
+
49
+ .sidebar[data-side="right"] {
50
+ border-right: none;
51
+ border-left: 1px solid var(--sidebar-border);
52
+ order: 1;
53
+ }
54
+
55
+ .sidebar__inner {
56
+ display: flex;
57
+ flex-direction: column;
58
+ height: 100svh;
59
+ position: sticky;
60
+ top: 0;
61
+ overflow: hidden;
62
+ }
63
+
64
+ /* collapsed: offcanvas → 0 폭 */
65
+ .sidebar[data-state="collapsed"][data-collapsible="offcanvas"] {
66
+ width: 0;
67
+ border-right-width: 0;
68
+ border-left-width: 0;
69
+ overflow: hidden;
70
+ }
71
+
72
+ /* collapsed: icon → 아이콘만 */
73
+ .sidebar[data-state="collapsed"][data-collapsible="icon"] {
74
+ width: var(--sidebar-width-icon);
75
+ }
76
+ .sidebar[data-state="collapsed"][data-collapsible="icon"] .sidebar__group-label,
77
+ .sidebar[data-state="collapsed"][data-collapsible="icon"] .sidebar__menu-button > span,
78
+ .sidebar[data-state="collapsed"][data-collapsible="icon"] .sidebar__menu-sub {
79
+ display: none;
80
+ }
81
+ .sidebar[data-state="collapsed"][data-collapsible="icon"] .sidebar__menu-button {
82
+ justify-content: center;
83
+ padding: var(--space-2);
84
+ }
85
+
86
+ /* variant: floating */
87
+ .sidebar[data-variant="floating"] {
88
+ border: none;
89
+ padding: var(--space-2);
90
+ background: transparent;
91
+ }
92
+ .sidebar[data-variant="floating"] .sidebar__inner {
93
+ border: 1px solid var(--sidebar-border);
94
+ border-radius: var(--radius);
95
+ background: var(--sidebar-bg);
96
+ height: calc(100svh - 1rem);
97
+ top: var(--space-2);
98
+ }
99
+
100
+ /* variant: inset (메인 영역이 카드 형태) */
101
+ .sidebar[data-variant="inset"] {
102
+ background: transparent;
103
+ border: none;
104
+ }
105
+
106
+ /* static (collapsible=none) */
107
+ .sidebar--static {
108
+ height: 100svh;
109
+ position: sticky;
110
+ top: 0;
111
+ }
112
+
113
+ /* ───────────── Mobile drawer ───────────── */
114
+ .sidebar--mobile {
115
+ position: fixed;
116
+ top: 0;
117
+ bottom: 0;
118
+ width: var(--sidebar-width-mobile);
119
+ z-index: var(--z-overlay);
120
+ transition: transform var(--duration-slow) ease;
121
+ border-right: 1px solid var(--sidebar-border);
122
+ }
123
+ .sidebar--mobile[data-side="left"] {
124
+ left: 0;
125
+ transform: translateX(-100%);
126
+ }
127
+ .sidebar--mobile[data-side="right"] {
128
+ right: 0;
129
+ transform: translateX(100%);
130
+ border-right: none;
131
+ border-left: 1px solid var(--sidebar-border);
132
+ }
133
+ .sidebar--mobile[data-state="open"] {
134
+ transform: translateX(0);
135
+ }
136
+
137
+ .sidebar__backdrop {
138
+ position: fixed;
139
+ inset: 0;
140
+ background: rgba(0, 0, 0, 0.25);
141
+ /* unprefixed 속성만 사용 — 최신 브라우저(Chrome/Firefox/Safari 18+)는 prefix 불필요.
142
+ 일부 CSS 트랜스포머가 prefix 중복 선언을 드롭하는 이슈를 피하기 위해 단일 선언 유지. */
143
+ backdrop-filter: blur(8px);
144
+ z-index: 40;
145
+ }
146
+
147
+ /* ───────────── Trigger ───────────── */
148
+ .sidebar__trigger {
149
+ display: inline-flex;
150
+ align-items: center;
151
+ justify-content: center;
152
+ width: 2rem;
153
+ height: 2rem;
154
+ border: 1px solid transparent;
155
+ background: transparent;
156
+ color: var(--foreground-muted);
157
+ border-radius: calc(var(--radius) - 2px);
158
+ cursor: pointer;
159
+ transition: background-color var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
160
+ }
161
+ .sidebar__trigger:hover {
162
+ background: var(--sidebar-accent);
163
+ color: var(--foreground);
164
+ }
165
+ .sidebar__trigger:focus-visible {
166
+ outline: var(--border-width-strong) solid var(--foreground);
167
+ outline-offset: 2px;
168
+ }
169
+
170
+ /* ───────────── Panel (보조 확장 패널) ─────────────
171
+ * 레일(사이드바)과 Inset 사이에 위치. 활성 시 너비를 차지해 Inset을 밀어냄.
172
+ * 모바일에서는 드로어 형태로 오버레이. */
173
+ .sidebar__panel {
174
+ --sidebar-panel-width: 20rem;
175
+
176
+ display: flex;
177
+ flex-direction: column;
178
+ width: var(--sidebar-panel-width);
179
+ flex-shrink: 0;
180
+ background: var(--background);
181
+ border-right: 1px solid var(--sidebar-border);
182
+ position: relative;
183
+ z-index: 4;
184
+ overflow: hidden;
185
+ animation: sh-ui-sidebar-panel-in 180ms ease;
186
+ }
187
+
188
+ .sidebar__panel[data-state="closed"] {
189
+ display: none;
190
+ }
191
+
192
+ @keyframes sh-ui-sidebar-panel-in {
193
+ from { transform: translateX(-8px); opacity: 0; }
194
+ to { transform: translateX(0); opacity: 1; }
195
+ }
196
+
197
+ .sidebar__panel-header {
198
+ display: flex;
199
+ align-items: center;
200
+ gap: var(--space-2);
201
+ padding: 0.875rem var(--space-4);
202
+ border-bottom: 1px solid var(--sidebar-border);
203
+ font-weight: var(--weight-semibold);
204
+ font-size: 0.9375rem;
205
+ }
206
+
207
+ .sidebar__panel-content {
208
+ flex: 1 1 auto;
209
+ min-height: 0;
210
+ overflow-y: auto;
211
+ padding: var(--space-3) var(--space-4) var(--space-4);
212
+ }
213
+
214
+ .sidebar__panel-close {
215
+ position: absolute;
216
+ top: var(--space-2);
217
+ right: var(--space-2);
218
+ display: inline-flex;
219
+ align-items: center;
220
+ justify-content: center;
221
+ width: 2rem;
222
+ height: 2rem;
223
+ border: 0;
224
+ border-radius: calc(var(--radius) - 2px);
225
+ background: transparent;
226
+ color: var(--foreground-muted);
227
+ font-size: var(--text-lg);
228
+ line-height: 1;
229
+ cursor: pointer;
230
+ transition: background-color var(--duration-fast), color var(--duration-fast);
231
+ }
232
+ .sidebar__panel-close:hover {
233
+ background: var(--sidebar-accent);
234
+ color: var(--foreground);
235
+ }
236
+
237
+ /* 모바일: 패널은 드로어 위에 오버레이 */
238
+ @media (max-width: 47.9375rem) {
239
+ .sidebar__panel {
240
+ position: fixed;
241
+ top: 0;
242
+ bottom: 0;
243
+ left: 0;
244
+ width: min(var(--sidebar-panel-width), 90vw);
245
+ z-index: var(--z-modal);
246
+ border-right: 1px solid var(--sidebar-border);
247
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
248
+ }
249
+ }
250
+ .sidebar-wrapper[data-embedded] .sidebar__panel {
251
+ position: relative;
252
+ }
253
+
254
+ /* ───────────── Inset (main) ───────────── */
255
+ .sidebar-inset {
256
+ flex: 1 1 0%;
257
+ min-width: 0;
258
+ background: var(--background);
259
+ display: flex;
260
+ flex-direction: column;
261
+ }
262
+
263
+ /* variant=inset일 때 main이 카드처럼 보이도록 wrapper 클래스로 처리하고 싶으면
264
+ :has() 없이도 동작하게 사용자가 직접 클래스 조정 가능. 기본은 평면. */
265
+
266
+ /* ───────────── Header / Footer / Content / Separator ───────────── */
267
+ .sidebar__header,
268
+ .sidebar__footer {
269
+ display: flex;
270
+ flex-direction: column;
271
+ gap: var(--space-2);
272
+ padding: var(--space-2);
273
+ overflow: hidden;
274
+ }
275
+
276
+ .sidebar__content {
277
+ display: flex;
278
+ flex-direction: column;
279
+ flex: 1 1 0%;
280
+ min-height: 0;
281
+ overflow-y: auto;
282
+ gap: 0;
283
+ }
284
+
285
+ .sidebar__separator {
286
+ margin: var(--space-1) var(--space-2);
287
+ border: none;
288
+ border-top: 1px solid var(--sidebar-border);
289
+ width: auto;
290
+ }
291
+
292
+ /* ───────────── Group ───────────── */
293
+ .sidebar__group {
294
+ display: flex;
295
+ flex-direction: column;
296
+ padding: var(--space-2);
297
+ min-width: 0;
298
+ }
299
+
300
+ .sidebar__group-label {
301
+ display: flex;
302
+ align-items: center;
303
+ height: 2rem;
304
+ padding: 0 var(--space-2);
305
+ font-size: var(--text-xs);
306
+ font-weight: var(--weight-medium);
307
+ color: var(--foreground-muted);
308
+ border-radius: calc(var(--radius) - 2px);
309
+ }
310
+
311
+ .sidebar__group-content {
312
+ width: 100%;
313
+ font-size: var(--text-sm);
314
+ }
315
+
316
+ /* ───────────── Menu ───────────── */
317
+ .sidebar__menu {
318
+ list-style: none;
319
+ margin: 0;
320
+ padding: 0;
321
+ display: flex;
322
+ flex-direction: column;
323
+ min-width: 0;
324
+ gap: 0;
325
+ }
326
+
327
+ .sidebar__menu-item {
328
+ position: relative;
329
+ margin: 0;
330
+ }
331
+
332
+ .sidebar__menu-button {
333
+ display: flex;
334
+ width: 100%;
335
+ align-items: center;
336
+ gap: var(--space-2);
337
+ padding: var(--space-2);
338
+ text-align: left;
339
+ font-size: var(--text-sm);
340
+ color: var(--sidebar-fg);
341
+ background: transparent;
342
+ border: none;
343
+ border-radius: calc(var(--radius) - 2px);
344
+ cursor: pointer;
345
+ transition: background-color var(--duration-fast), color var(--duration-fast);
346
+ text-decoration: none;
347
+ font-family: inherit;
348
+ line-height: 1.4;
349
+ }
350
+ .sidebar__menu-button > svg {
351
+ width: 1rem;
352
+ height: 1rem;
353
+ flex-shrink: 0;
354
+ }
355
+ .sidebar__menu-button > span {
356
+ flex: 1 1 0%;
357
+ min-width: 0;
358
+ overflow: hidden;
359
+ text-overflow: ellipsis;
360
+ white-space: nowrap;
361
+ }
362
+ .sidebar__menu-button:hover {
363
+ background: var(--sidebar-accent);
364
+ color: var(--sidebar-accent-fg);
365
+ }
366
+ .sidebar__menu-button:focus-visible {
367
+ outline: var(--border-width-strong) solid var(--foreground);
368
+ outline-offset: -2px;
369
+ }
370
+ .sidebar__menu-button[data-active] {
371
+ background: var(--primary);
372
+ color: var(--primary-foreground);
373
+ font-weight: var(--weight-semibold);
374
+ }
375
+ .sidebar__menu-button[data-active]:hover {
376
+ background: var(--primary-hover);
377
+ color: var(--primary-foreground);
378
+ }
379
+ .sidebar__menu-button:disabled,
380
+ .sidebar__menu-button[aria-disabled="true"] {
381
+ opacity: var(--opacity-disabled);
382
+ pointer-events: none;
383
+ }
384
+
385
+ .sidebar__menu-button--sm {
386
+ height: 1.75rem;
387
+ padding: var(--space-1) var(--space-2);
388
+ font-size: 0.8125rem;
389
+ }
390
+ .sidebar__menu-button--md {
391
+ /* default */
392
+ }
393
+ .sidebar__menu-button--lg {
394
+ padding: var(--space-3);
395
+ font-size: 0.9375rem;
396
+ }
397
+
398
+ /* ───────────── Sub menu ───────────── */
399
+ .sidebar__menu-sub {
400
+ list-style: none;
401
+ margin: 0.125rem 0 0;
402
+ padding: 0.125rem 0 0.125rem 0.625rem;
403
+ margin-left: 0.875rem;
404
+ border-left: 1px solid var(--sidebar-border);
405
+ display: flex;
406
+ flex-direction: column;
407
+ gap: 0.125rem;
408
+ min-width: 0;
409
+ }
410
+
411
+ .sidebar__menu-sub-item {
412
+ position: relative;
413
+ }
414
+
415
+ .sidebar__menu-sub-button {
416
+ display: flex;
417
+ align-items: center;
418
+ gap: var(--space-2);
419
+ height: 1.75rem;
420
+ padding: 0 var(--space-2);
421
+ border-radius: calc(var(--radius) - 2px);
422
+ font-size: 0.8125rem;
423
+ color: var(--sidebar-fg);
424
+ text-decoration: none;
425
+ transition: background-color var(--duration-fast), color var(--duration-fast);
426
+ min-width: 0;
427
+ }
428
+ .sidebar__menu-sub-button > span {
429
+ flex: 1 1 0%;
430
+ min-width: 0;
431
+ overflow: hidden;
432
+ text-overflow: ellipsis;
433
+ white-space: nowrap;
434
+ }
435
+ .sidebar__menu-sub-button:hover {
436
+ background: var(--sidebar-accent);
437
+ color: var(--sidebar-accent-fg);
438
+ }
439
+ .sidebar__menu-sub-button[data-active] {
440
+ background: var(--primary);
441
+ color: var(--primary-foreground);
442
+ font-weight: var(--weight-semibold);
443
+ }
444
+ .sidebar__menu-sub-button[data-active]:hover {
445
+ background: var(--primary-hover);
446
+ color: var(--primary-foreground);
447
+ }
448
+ .sidebar__menu-sub-button--sm {
449
+ font-size: var(--text-xs);
450
+ }
451
+
452
+ /* ───────────── Collapsible ───────────── */
453
+ .sidebar__chevron {
454
+ width: 0.875rem !important;
455
+ height: 0.875rem !important;
456
+ margin-left: auto;
457
+ flex-shrink: 0;
458
+ transition: transform 150ms ease;
459
+ color: var(--foreground-muted);
460
+ }
461
+ .sidebar__collapsible-trigger[data-state="open"] .sidebar__chevron {
462
+ transform: rotate(90deg);
463
+ }
464
+
465
+ .sidebar__collapsible-content[data-state="closed"] {
466
+ display: none;
467
+ }
468
+
469
+ /* ───── Flyout (collapsed=icon 상태의 서브메뉴) ─────
470
+ * 실제 포지셔닝·보더·쉐도우는 Popover가 담당. 여기서는 내부 서브메뉴만 정돈. */
471
+ .sidebar__collapsible-flyout .sidebar__menu-sub {
472
+ display: flex !important; /* collapsed 상태 전역 숨김 규칙 override */
473
+ flex-direction: column;
474
+ gap: 0.125rem;
475
+ margin: 0;
476
+ padding: 0;
477
+ border-left: 0;
478
+ }
479
+ .sidebar__collapsible-flyout .sidebar__menu-sub-button {
480
+ padding-left: 0.625rem;
481
+ }
482
+
483
+ /* collapsed=icon 상태에서는 chevron 숨기고 content도 숨김 */
484
+ .sidebar[data-state="collapsed"][data-collapsible="icon"] .sidebar__chevron,
485
+ .sidebar[data-state="collapsed"][data-collapsible="icon"] .sidebar__collapsible-content {
486
+ display: none;
487
+ }
488
+
489
+ @media (prefers-reduced-motion: reduce) {
490
+ .sidebar,
491
+ .sidebar--mobile,
492
+ .sidebar__trigger,
493
+ .sidebar__menu-button,
494
+ .sidebar__menu-sub-button,
495
+ .sidebar__panel-close,
496
+ .sidebar__chevron {
497
+ transition: none;
498
+ }
499
+ .sidebar__panel {
500
+ animation: none;
501
+ }
502
+ }
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import styles from "./styles.module.css";
3
+
4
+
5
+ import { cn } from "@SH_UI_UTILS@";
6
+ /**
7
+ * 로딩 중 콘텐츠 자리를 채우는 placeholder 박스. 폭/높이는 인라인 스타일이나
8
+ * 클래스로 직접 지정한다. `aria-hidden`이 기본 적용되므로 스크린리더에 노출되지
9
+ * 않는다 — 로딩 상태 안내가 필요하면 부모에 `aria-busy`를 함께 둘 것.
10
+ */
11
+ export const Skeleton = React.forwardRef<
12
+ HTMLDivElement,
13
+ React.HTMLAttributes<HTMLDivElement>
14
+ >(({ className, ...props }, ref) => (
15
+ <div
16
+ ref={ref}
17
+ aria-hidden="true"
18
+ className={cn(styles.skeleton, className)}
19
+ {...props}
20
+ />
21
+ ));
22
+ Skeleton.displayName = "Skeleton";
@@ -0,0 +1,24 @@
1
+ .skeleton {
2
+ display: block;
3
+ width: 100%;
4
+ height: 1rem;
5
+ background: var(--background-muted);
6
+ border-radius: calc(var(--radius) - 2px);
7
+ animation: sh-ui-skeleton-pulse 1.6s ease-in-out infinite;
8
+ }
9
+
10
+ @keyframes sh-ui-skeleton-pulse {
11
+ 0%,
12
+ 100% {
13
+ opacity: 1;
14
+ }
15
+ 50% {
16
+ opacity: 0.55;
17
+ }
18
+ }
19
+
20
+ @media (prefers-reduced-motion: reduce) {
21
+ .skeleton {
22
+ animation: none;
23
+ }
24
+ }