sh-ui-cli 0.15.0 → 0.21.1

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 (163) hide show
  1. package/bin/sh-ui.mjs +6 -0
  2. package/data/changelog/versions.json +366 -0
  3. package/data/registry/flutter/foundation/sh_ui_tokens.dart +385 -0
  4. package/data/registry/flutter/registry.json +336 -0
  5. package/data/registry/flutter/widgets/sh_ui_accordion.dart +255 -0
  6. package/data/registry/flutter/widgets/sh_ui_app_shell.dart +267 -0
  7. package/data/registry/flutter/widgets/sh_ui_avatar.dart +95 -0
  8. package/data/registry/flutter/widgets/sh_ui_badge.dart +82 -0
  9. package/data/registry/flutter/widgets/sh_ui_breadcrumb.dart +107 -0
  10. package/data/registry/flutter/widgets/sh_ui_button.dart +201 -0
  11. package/data/registry/flutter/widgets/sh_ui_card.dart +159 -0
  12. package/data/registry/flutter/widgets/sh_ui_carousel.dart +204 -0
  13. package/data/registry/flutter/widgets/sh_ui_checkbox.dart +154 -0
  14. package/data/registry/flutter/widgets/sh_ui_color_picker.dart +264 -0
  15. package/data/registry/flutter/widgets/sh_ui_combobox.dart +614 -0
  16. package/data/registry/flutter/widgets/sh_ui_context_menu.dart +71 -0
  17. package/data/registry/flutter/widgets/sh_ui_date_picker.dart +648 -0
  18. package/data/registry/flutter/widgets/sh_ui_dialog.dart +567 -0
  19. package/data/registry/flutter/widgets/sh_ui_dropdown_menu.dart +251 -0
  20. package/data/registry/flutter/widgets/sh_ui_file_upload.dart +200 -0
  21. package/data/registry/flutter/widgets/sh_ui_header.dart +488 -0
  22. package/data/registry/flutter/widgets/sh_ui_input.dart +664 -0
  23. package/data/registry/flutter/widgets/sh_ui_label.dart +145 -0
  24. package/data/registry/flutter/widgets/sh_ui_menubar.dart +98 -0
  25. package/data/registry/flutter/widgets/sh_ui_pagination.dart +276 -0
  26. package/data/registry/flutter/widgets/sh_ui_popover.dart +248 -0
  27. package/data/registry/flutter/widgets/sh_ui_progress.dart +47 -0
  28. package/data/registry/flutter/widgets/sh_ui_radio.dart +108 -0
  29. package/data/registry/flutter/widgets/sh_ui_select.dart +904 -0
  30. package/data/registry/flutter/widgets/sh_ui_separator.dart +42 -0
  31. package/data/registry/flutter/widgets/sh_ui_sidebar.dart +1116 -0
  32. package/data/registry/flutter/widgets/sh_ui_skeleton.dart +129 -0
  33. package/data/registry/flutter/widgets/sh_ui_slider.dart +147 -0
  34. package/data/registry/flutter/widgets/sh_ui_spinner.dart +56 -0
  35. package/data/registry/flutter/widgets/sh_ui_switch.dart +109 -0
  36. package/data/registry/flutter/widgets/sh_ui_tabs.dart +329 -0
  37. package/data/registry/flutter/widgets/sh_ui_textarea.dart +126 -0
  38. package/data/registry/flutter/widgets/sh_ui_toast.dart +362 -0
  39. package/data/registry/flutter/widgets/sh_ui_toggle.dart +229 -0
  40. package/data/registry/flutter/widgets/sh_ui_tooltip.dart +62 -0
  41. package/data/registry/react/components/accordion/index.tsx +85 -0
  42. package/data/registry/react/components/accordion/styles.css +94 -0
  43. package/data/registry/react/components/animations/animations.css +51 -0
  44. package/data/registry/react/components/avatar/index.tsx +75 -0
  45. package/data/registry/react/components/avatar/styles.css +36 -0
  46. package/data/registry/react/components/badge/index.tsx +42 -0
  47. package/data/registry/react/components/badge/styles.css +57 -0
  48. package/data/registry/react/components/base/base.css +102 -0
  49. package/data/registry/react/components/breadcrumb/index.tsx +154 -0
  50. package/data/registry/react/components/breadcrumb/styles.css +82 -0
  51. package/data/registry/react/components/breakpoints/breakpoints.css +17 -0
  52. package/data/registry/react/components/button/index.tsx +47 -0
  53. package/data/registry/react/components/button/styles.css +93 -0
  54. package/data/registry/react/components/card/index.tsx +86 -0
  55. package/data/registry/react/components/card/styles.css +73 -0
  56. package/data/registry/react/components/carousel/index.tsx +432 -0
  57. package/data/registry/react/components/carousel/styles.css +155 -0
  58. package/data/registry/react/components/checkbox/index.tsx +98 -0
  59. package/data/registry/react/components/checkbox/styles.css +75 -0
  60. package/data/registry/react/components/code-panel/copy.tsx +56 -0
  61. package/data/registry/react/components/code-panel/index.tsx +193 -0
  62. package/data/registry/react/components/code-panel/styles.css +124 -0
  63. package/data/registry/react/components/color-picker/index.tsx +466 -0
  64. package/data/registry/react/components/color-picker/styles.css +166 -0
  65. package/data/registry/react/components/combobox/index.tsx +167 -0
  66. package/data/registry/react/components/combobox/styles.css +151 -0
  67. package/data/registry/react/components/context-menu/index.tsx +253 -0
  68. package/data/registry/react/components/context-menu/styles.css +140 -0
  69. package/data/registry/react/components/date-picker/index.tsx +757 -0
  70. package/data/registry/react/components/date-picker/styles.css +279 -0
  71. package/data/registry/react/components/dialog/index.tsx +97 -0
  72. package/data/registry/react/components/dialog/styles.css +127 -0
  73. package/data/registry/react/components/dropdown-menu/index.tsx +257 -0
  74. package/data/registry/react/components/dropdown-menu/styles.css +150 -0
  75. package/data/registry/react/components/file-upload/index.tsx +489 -0
  76. package/data/registry/react/components/file-upload/styles.css +170 -0
  77. package/data/registry/react/components/focus-ring/focus-ring.css +23 -0
  78. package/data/registry/react/components/form/context.ts +92 -0
  79. package/data/registry/react/components/form/field.test.tsx +230 -0
  80. package/data/registry/react/components/form/field.tsx +236 -0
  81. package/data/registry/react/components/form/focus-first-error.ts +54 -0
  82. package/data/registry/react/components/form/form.section.test.tsx +58 -0
  83. package/data/registry/react/components/form/form.test.tsx +146 -0
  84. package/data/registry/react/components/form/form.tsx +180 -0
  85. package/data/registry/react/components/form/index.tsx +61 -0
  86. package/data/registry/react/components/form/steps.test.tsx +106 -0
  87. package/data/registry/react/components/form/steps.tsx +193 -0
  88. package/data/registry/react/components/form/store.test.ts +206 -0
  89. package/data/registry/react/components/form/store.ts +318 -0
  90. package/data/registry/react/components/form/styles.css +47 -0
  91. package/data/registry/react/components/form/types.ts +104 -0
  92. package/data/registry/react/components/form/use-sh-ui-form.ts +15 -0
  93. package/data/registry/react/components/form/utils.test.ts +44 -0
  94. package/data/registry/react/components/form/utils.ts +49 -0
  95. package/data/registry/react/components/form/validation.test.ts +67 -0
  96. package/data/registry/react/components/form/validation.ts +64 -0
  97. package/data/registry/react/components/form-rhf/README.md +27 -0
  98. package/data/registry/react/components/form-rhf/index.tsx +289 -0
  99. package/data/registry/react/components/form-rhf/rhf.test.tsx +42 -0
  100. package/data/registry/react/components/form-tanstack/README.md +27 -0
  101. package/data/registry/react/components/form-tanstack/index.tsx +352 -0
  102. package/data/registry/react/components/form-tanstack/tanstack.test.tsx +45 -0
  103. package/data/registry/react/components/form-yup/README.md +22 -0
  104. package/data/registry/react/components/form-yup/index.tsx +50 -0
  105. package/data/registry/react/components/form-yup/yup.test.ts +27 -0
  106. package/data/registry/react/components/header/index.tsx +257 -0
  107. package/data/registry/react/components/header/styles.css +190 -0
  108. package/data/registry/react/components/input/index.tsx +517 -0
  109. package/data/registry/react/components/input/styles.css +203 -0
  110. package/data/registry/react/components/label/index.tsx +54 -0
  111. package/data/registry/react/components/label/styles.css +90 -0
  112. package/data/registry/react/components/menubar/index.tsx +34 -0
  113. package/data/registry/react/components/menubar/styles.css +45 -0
  114. package/data/registry/react/components/pagination/index.tsx +271 -0
  115. package/data/registry/react/components/pagination/styles.css +105 -0
  116. package/data/registry/react/components/popover/index.tsx +115 -0
  117. package/data/registry/react/components/popover/styles.css +65 -0
  118. package/data/registry/react/components/progress/index.tsx +56 -0
  119. package/data/registry/react/components/progress/styles.css +41 -0
  120. package/data/registry/react/components/radio/index.tsx +67 -0
  121. package/data/registry/react/components/radio/styles.css +80 -0
  122. package/data/registry/react/components/select/index.tsx +236 -0
  123. package/data/registry/react/components/select/styles.css +193 -0
  124. package/data/registry/react/components/separator/index.tsx +48 -0
  125. package/data/registry/react/components/separator/styles.css +15 -0
  126. package/data/registry/react/components/sidebar/index.tsx +1084 -0
  127. package/data/registry/react/components/sidebar/styles.css +502 -0
  128. package/data/registry/react/components/skeleton/index.tsx +24 -0
  129. package/data/registry/react/components/skeleton/styles.css +24 -0
  130. package/data/registry/react/components/slider/index.tsx +300 -0
  131. package/data/registry/react/components/slider/styles.css +64 -0
  132. package/data/registry/react/components/spinner/index.tsx +40 -0
  133. package/data/registry/react/components/spinner/styles.css +37 -0
  134. package/data/registry/react/components/switch/index.tsx +41 -0
  135. package/data/registry/react/components/switch/styles.css +83 -0
  136. package/data/registry/react/components/tabs/index.tsx +93 -0
  137. package/data/registry/react/components/tabs/styles.css +148 -0
  138. package/data/registry/react/components/textarea/index.tsx +25 -0
  139. package/data/registry/react/components/textarea/styles.css +54 -0
  140. package/data/registry/react/components/theme/index.tsx +91 -0
  141. package/data/registry/react/components/toast/index.tsx +257 -0
  142. package/data/registry/react/components/toast/styles.css +290 -0
  143. package/data/registry/react/components/toggle/index.tsx +133 -0
  144. package/data/registry/react/components/toggle/styles.css +85 -0
  145. package/data/registry/react/components/tooltip/index.tsx +85 -0
  146. package/data/registry/react/components/tooltip/styles.css +44 -0
  147. package/data/registry/react/components/z-index/z-index.css +16 -0
  148. package/data/registry/react/hooks/use-active-section.ts +104 -0
  149. package/data/registry/react/hooks/use-media-query.ts +27 -0
  150. package/data/registry/react/lib/cn.ts +39 -0
  151. package/data/registry/react/peer-versions.json +10 -0
  152. package/data/registry/react/registry.json +835 -0
  153. package/data/summaries/flutter.json +42 -0
  154. package/data/summaries/react.json +50 -0
  155. package/data/tokens/build.mjs +553 -0
  156. package/data/tokens/src/primitives.json +146 -0
  157. package/data/tokens/src/semantic.json +146 -0
  158. package/package.json +9 -2
  159. package/src/add.mjs +41 -15
  160. package/src/list.mjs +3 -11
  161. package/src/mcp.mjs +308 -0
  162. package/src/paths.mjs +59 -0
  163. package/src/remove.mjs +4 -11
@@ -0,0 +1,502 @@
1
+ /* ───────────── Tokens ───────────── */
2
+ .sh-ui-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
+ .sh-ui-sidebar-wrapper[data-embedded] {
19
+ min-height: 0;
20
+ height: 100%;
21
+ }
22
+ .sh-ui-sidebar-wrapper[data-embedded] .sh-ui-sidebar__inner,
23
+ .sh-ui-sidebar-wrapper[data-embedded] .sh-ui-sidebar--static {
24
+ height: 100%;
25
+ position: relative;
26
+ top: 0;
27
+ }
28
+ .sh-ui-sidebar-wrapper[data-embedded] .sh-ui-sidebar--mobile {
29
+ position: absolute;
30
+ }
31
+ .sh-ui-sidebar-wrapper[data-embedded] .sh-ui-sidebar__backdrop {
32
+ position: absolute;
33
+ }
34
+
35
+ /* ───────────── Sidebar (desktop) ───────────── */
36
+ .sh-ui-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
+ .sh-ui-sidebar[data-side="right"] {
50
+ border-right: none;
51
+ border-left: 1px solid var(--sidebar-border);
52
+ order: 1;
53
+ }
54
+
55
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-sidebar[data-state="collapsed"][data-collapsible="icon"] {
74
+ width: var(--sidebar-width-icon);
75
+ }
76
+ .sh-ui-sidebar[data-state="collapsed"][data-collapsible="icon"] .sh-ui-sidebar__group-label,
77
+ .sh-ui-sidebar[data-state="collapsed"][data-collapsible="icon"] .sh-ui-sidebar__menu-button > span,
78
+ .sh-ui-sidebar[data-state="collapsed"][data-collapsible="icon"] .sh-ui-sidebar__menu-sub {
79
+ display: none;
80
+ }
81
+ .sh-ui-sidebar[data-state="collapsed"][data-collapsible="icon"] .sh-ui-sidebar__menu-button {
82
+ justify-content: center;
83
+ padding: var(--space-2);
84
+ }
85
+
86
+ /* variant: floating */
87
+ .sh-ui-sidebar[data-variant="floating"] {
88
+ border: none;
89
+ padding: var(--space-2);
90
+ background: transparent;
91
+ }
92
+ .sh-ui-sidebar[data-variant="floating"] .sh-ui-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
+ .sh-ui-sidebar[data-variant="inset"] {
102
+ background: transparent;
103
+ border: none;
104
+ }
105
+
106
+ /* static (collapsible=none) */
107
+ .sh-ui-sidebar--static {
108
+ height: 100svh;
109
+ position: sticky;
110
+ top: 0;
111
+ }
112
+
113
+ /* ───────────── Mobile drawer ───────────── */
114
+ .sh-ui-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
+ .sh-ui-sidebar--mobile[data-side="left"] {
124
+ left: 0;
125
+ transform: translateX(-100%);
126
+ }
127
+ .sh-ui-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
+ .sh-ui-sidebar--mobile[data-state="open"] {
134
+ transform: translateX(0);
135
+ }
136
+
137
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-sidebar__trigger:hover {
162
+ background: var(--sidebar-accent);
163
+ color: var(--foreground);
164
+ }
165
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-sidebar__panel-close:hover {
233
+ background: var(--sidebar-accent);
234
+ color: var(--foreground);
235
+ }
236
+
237
+ /* 모바일: 패널은 드로어 위에 오버레이 */
238
+ @media (max-width: 47.9375rem) {
239
+ .sh-ui-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
+ .sh-ui-sidebar-wrapper[data-embedded] .sh-ui-sidebar__panel {
251
+ position: relative;
252
+ }
253
+
254
+ /* ───────────── Inset (main) ───────────── */
255
+ .sh-ui-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
+ .sh-ui-sidebar__header,
268
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-sidebar__group {
294
+ display: flex;
295
+ flex-direction: column;
296
+ padding: var(--space-2);
297
+ min-width: 0;
298
+ }
299
+
300
+ .sh-ui-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
+ .sh-ui-sidebar__group-content {
312
+ width: 100%;
313
+ font-size: var(--text-sm);
314
+ }
315
+
316
+ /* ───────────── Menu ───────────── */
317
+ .sh-ui-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
+ .sh-ui-sidebar__menu-item {
328
+ position: relative;
329
+ margin: 0;
330
+ }
331
+
332
+ .sh-ui-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
+ .sh-ui-sidebar__menu-button > svg {
351
+ width: 1rem;
352
+ height: 1rem;
353
+ flex-shrink: 0;
354
+ }
355
+ .sh-ui-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
+ .sh-ui-sidebar__menu-button:hover {
363
+ background: var(--sidebar-accent);
364
+ color: var(--sidebar-accent-fg);
365
+ }
366
+ .sh-ui-sidebar__menu-button:focus-visible {
367
+ outline: var(--border-width-strong) solid var(--foreground);
368
+ outline-offset: -2px;
369
+ }
370
+ .sh-ui-sidebar__menu-button[data-active] {
371
+ background: var(--primary);
372
+ color: var(--primary-foreground);
373
+ font-weight: var(--weight-semibold);
374
+ }
375
+ .sh-ui-sidebar__menu-button[data-active]:hover {
376
+ background: var(--primary-hover);
377
+ color: var(--primary-foreground);
378
+ }
379
+ .sh-ui-sidebar__menu-button:disabled,
380
+ .sh-ui-sidebar__menu-button[aria-disabled="true"] {
381
+ opacity: var(--opacity-disabled);
382
+ pointer-events: none;
383
+ }
384
+
385
+ .sh-ui-sidebar__menu-button--sm {
386
+ height: 1.75rem;
387
+ padding: var(--space-1) var(--space-2);
388
+ font-size: 0.8125rem;
389
+ }
390
+ .sh-ui-sidebar__menu-button--md {
391
+ /* default */
392
+ }
393
+ .sh-ui-sidebar__menu-button--lg {
394
+ padding: var(--space-3);
395
+ font-size: 0.9375rem;
396
+ }
397
+
398
+ /* ───────────── Sub menu ───────────── */
399
+ .sh-ui-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
+ .sh-ui-sidebar__menu-sub-item {
412
+ position: relative;
413
+ }
414
+
415
+ .sh-ui-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
+ .sh-ui-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
+ .sh-ui-sidebar__menu-sub-button:hover {
436
+ background: var(--sidebar-accent);
437
+ color: var(--sidebar-accent-fg);
438
+ }
439
+ .sh-ui-sidebar__menu-sub-button[data-active] {
440
+ background: var(--primary);
441
+ color: var(--primary-foreground);
442
+ font-weight: var(--weight-semibold);
443
+ }
444
+ .sh-ui-sidebar__menu-sub-button[data-active]:hover {
445
+ background: var(--primary-hover);
446
+ color: var(--primary-foreground);
447
+ }
448
+ .sh-ui-sidebar__menu-sub-button--sm {
449
+ font-size: var(--text-xs);
450
+ }
451
+
452
+ /* ───────────── Collapsible ───────────── */
453
+ .sh-ui-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
+ .sh-ui-sidebar__collapsible-trigger[data-state="open"] .sh-ui-sidebar__chevron {
462
+ transform: rotate(90deg);
463
+ }
464
+
465
+ .sh-ui-sidebar__collapsible-content[data-state="closed"] {
466
+ display: none;
467
+ }
468
+
469
+ /* ───── Flyout (collapsed=icon 상태의 서브메뉴) ─────
470
+ * 실제 포지셔닝·보더·쉐도우는 Popover가 담당. 여기서는 내부 서브메뉴만 정돈. */
471
+ .sh-ui-sidebar__collapsible-flyout .sh-ui-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
+ .sh-ui-sidebar__collapsible-flyout .sh-ui-sidebar__menu-sub-button {
480
+ padding-left: 0.625rem;
481
+ }
482
+
483
+ /* collapsed=icon 상태에서는 chevron 숨기고 content도 숨김 */
484
+ .sh-ui-sidebar[data-state="collapsed"][data-collapsible="icon"] .sh-ui-sidebar__chevron,
485
+ .sh-ui-sidebar[data-state="collapsed"][data-collapsible="icon"] .sh-ui-sidebar__collapsible-content {
486
+ display: none;
487
+ }
488
+
489
+ @media (prefers-reduced-motion: reduce) {
490
+ .sh-ui-sidebar,
491
+ .sh-ui-sidebar--mobile,
492
+ .sh-ui-sidebar__trigger,
493
+ .sh-ui-sidebar__menu-button,
494
+ .sh-ui-sidebar__menu-sub-button,
495
+ .sh-ui-sidebar__panel-close,
496
+ .sh-ui-sidebar__chevron {
497
+ transition: none;
498
+ }
499
+ .sh-ui-sidebar__panel {
500
+ animation: none;
501
+ }
502
+ }
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import "./styles.css";
3
+
4
+ function cx(...args: (string | undefined | false | null)[]) {
5
+ return args.filter(Boolean).join(" ");
6
+ }
7
+
8
+ /**
9
+ * 로딩 중 콘텐츠 자리를 채우는 placeholder 박스. 폭/높이는 인라인 스타일이나
10
+ * 클래스로 직접 지정한다. `aria-hidden`이 기본 적용되므로 스크린리더에 노출되지
11
+ * 않는다 — 로딩 상태 안내가 필요하면 부모에 `aria-busy`를 함께 둘 것.
12
+ */
13
+ export const Skeleton = React.forwardRef<
14
+ HTMLDivElement,
15
+ React.HTMLAttributes<HTMLDivElement>
16
+ >(({ className, ...props }, ref) => (
17
+ <div
18
+ ref={ref}
19
+ aria-hidden="true"
20
+ className={cx("sh-ui-skeleton", className)}
21
+ {...props}
22
+ />
23
+ ));
24
+ Skeleton.displayName = "Skeleton";
@@ -0,0 +1,24 @@
1
+ .sh-ui-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
+ .sh-ui-skeleton {
22
+ animation: none;
23
+ }
24
+ }