sh-ui-cli 0.45.3 → 0.47.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 (93) hide show
  1. package/data/changelog/versions.json +26 -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/button/index.module.tsx +45 -0
  11. package/data/registry/react/components/button/styles.module.css +92 -0
  12. package/data/registry/react/components/calendar/index.module.tsx +806 -0
  13. package/data/registry/react/components/calendar/styles.module.css +213 -0
  14. package/data/registry/react/components/card/index.module.tsx +63 -0
  15. package/data/registry/react/components/card/styles.module.css +73 -0
  16. package/data/registry/react/components/carousel/index.module.tsx +430 -0
  17. package/data/registry/react/components/carousel/styles.module.css +155 -0
  18. package/data/registry/react/components/checkbox/index.module.tsx +96 -0
  19. package/data/registry/react/components/checkbox/styles.module.css +75 -0
  20. package/data/registry/react/components/code-editor/index.module.tsx +230 -0
  21. package/data/registry/react/components/code-editor/styles.module.css +76 -0
  22. package/data/registry/react/components/code-panel/index.module.tsx +191 -0
  23. package/data/registry/react/components/code-panel/styles.module.css +124 -0
  24. package/data/registry/react/components/color-picker/index.module.tsx +467 -0
  25. package/data/registry/react/components/color-picker/styles.module.css +166 -0
  26. package/data/registry/react/components/combobox/index.module.tsx +165 -0
  27. package/data/registry/react/components/combobox/styles.module.css +151 -0
  28. package/data/registry/react/components/context-menu/index.module.tsx +251 -0
  29. package/data/registry/react/components/context-menu/styles.module.css +140 -0
  30. package/data/registry/react/components/date-picker/index.module.tsx +520 -0
  31. package/data/registry/react/components/date-picker/styles.module.css +103 -0
  32. package/data/registry/react/components/dialog/index.module.tsx +95 -0
  33. package/data/registry/react/components/dialog/styles.module.css +127 -0
  34. package/data/registry/react/components/dropdown-menu/index.module.tsx +255 -0
  35. package/data/registry/react/components/dropdown-menu/styles.module.css +150 -0
  36. package/data/registry/react/components/file-upload/index.module.tsx +487 -0
  37. package/data/registry/react/components/file-upload/styles.module.css +170 -0
  38. package/data/registry/react/components/form/index.module.tsx +61 -0
  39. package/data/registry/react/components/form/styles.module.css +47 -0
  40. package/data/registry/react/components/header/index.module.tsx +805 -0
  41. package/data/registry/react/components/header/styles.module.css +350 -0
  42. package/data/registry/react/components/input/index.module.tsx +486 -0
  43. package/data/registry/react/components/input/styles.module.css +200 -0
  44. package/data/registry/react/components/label/index.module.tsx +52 -0
  45. package/data/registry/react/components/label/styles.module.css +90 -0
  46. package/data/registry/react/components/markdown-editor/index.module.tsx +119 -0
  47. package/data/registry/react/components/markdown-editor/styles.module.css +160 -0
  48. package/data/registry/react/components/menubar/index.module.tsx +32 -0
  49. package/data/registry/react/components/menubar/styles.module.css +45 -0
  50. package/data/registry/react/components/numeric-input/index.module.tsx +148 -0
  51. package/data/registry/react/components/numeric-input/styles.module.css +56 -0
  52. package/data/registry/react/components/page-toc/index.module.tsx +174 -0
  53. package/data/registry/react/components/page-toc/styles.module.css +82 -0
  54. package/data/registry/react/components/pagination/index.module.tsx +269 -0
  55. package/data/registry/react/components/pagination/styles.module.css +105 -0
  56. package/data/registry/react/components/popover/index.module.tsx +113 -0
  57. package/data/registry/react/components/popover/styles.module.css +65 -0
  58. package/data/registry/react/components/progress/index.module.tsx +54 -0
  59. package/data/registry/react/components/progress/styles.module.css +41 -0
  60. package/data/registry/react/components/radio/index.module.tsx +65 -0
  61. package/data/registry/react/components/radio/styles.module.css +80 -0
  62. package/data/registry/react/components/rich-text-editor/index.module.tsx +348 -0
  63. package/data/registry/react/components/rich-text-editor/styles.module.css +196 -0
  64. package/data/registry/react/components/select/index.module.tsx +234 -0
  65. package/data/registry/react/components/select/styles.module.css +193 -0
  66. package/data/registry/react/components/separator/index.module.tsx +46 -0
  67. package/data/registry/react/components/separator/styles.module.css +15 -0
  68. package/data/registry/react/components/sidebar/index.module.tsx +1067 -0
  69. package/data/registry/react/components/sidebar/styles.module.css +502 -0
  70. package/data/registry/react/components/skeleton/index.module.tsx +22 -0
  71. package/data/registry/react/components/skeleton/styles.module.css +24 -0
  72. package/data/registry/react/components/slider/index.module.tsx +298 -0
  73. package/data/registry/react/components/slider/styles.module.css +64 -0
  74. package/data/registry/react/components/spinner/index.module.tsx +38 -0
  75. package/data/registry/react/components/spinner/styles.module.css +37 -0
  76. package/data/registry/react/components/switch/index.module.tsx +39 -0
  77. package/data/registry/react/components/switch/styles.module.css +83 -0
  78. package/data/registry/react/components/tabs/index.module.tsx +91 -0
  79. package/data/registry/react/components/tabs/styles.module.css +148 -0
  80. package/data/registry/react/components/textarea/index.module.tsx +23 -0
  81. package/data/registry/react/components/textarea/styles.module.css +54 -0
  82. package/data/registry/react/components/toast/index.module.tsx +258 -0
  83. package/data/registry/react/components/toast/styles.module.css +290 -0
  84. package/data/registry/react/components/toggle/index.module.tsx +131 -0
  85. package/data/registry/react/components/toggle/styles.module.css +85 -0
  86. package/data/registry/react/components/tooltip/index.module.tsx +83 -0
  87. package/data/registry/react/components/tooltip/styles.module.css +44 -0
  88. package/data/registry/react/registry.json +604 -1
  89. package/data/tokens/build.mjs +4 -0
  90. package/package.json +1 -1
  91. package/src/add.mjs +12 -12
  92. package/src/api.d.ts +4 -3
  93. package/src/constants.js +4 -3
@@ -0,0 +1,213 @@
1
+ /* ── Calendar root ── */
2
+
3
+ .calendar {
4
+ display: inline-flex;
5
+ gap: var(--space-4);
6
+ user-select: none;
7
+ }
8
+
9
+ .calendar--multi {
10
+ flex-wrap: wrap;
11
+ }
12
+
13
+ .calendar__month {
14
+ width: 17.5rem;
15
+ }
16
+
17
+ /* ── Header (compound) ── */
18
+
19
+ .calendar__header {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: space-between;
23
+ gap: var(--space-1);
24
+ margin-bottom: var(--space-2);
25
+ }
26
+
27
+ .calendar__title {
28
+ display: inline-flex;
29
+ align-items: center;
30
+ gap: var(--space-1);
31
+ flex: 1 1 auto;
32
+ justify-content: center;
33
+ }
34
+
35
+ /* ── Nav buttons ── */
36
+
37
+ .calendar__nav {
38
+ display: inline-flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ width: 1.75rem;
42
+ height: 1.75rem;
43
+ padding: 0;
44
+ border: none;
45
+ border-radius: calc(var(--radius) - 2px);
46
+ background: transparent;
47
+ color: var(--foreground-muted);
48
+ cursor: pointer;
49
+ flex-shrink: 0;
50
+ transition: background-color var(--duration-fast), color var(--duration-fast);
51
+ }
52
+
53
+ .calendar__nav:hover:not(:disabled) {
54
+ background: var(--background-muted);
55
+ color: var(--foreground);
56
+ }
57
+
58
+ .calendar__nav:focus-visible {
59
+ outline: var(--border-width-strong) solid var(--foreground);
60
+ outline-offset: 2px;
61
+ }
62
+
63
+ .calendar__nav--placeholder {
64
+ visibility: hidden;
65
+ pointer-events: none;
66
+ }
67
+
68
+ /* ── Select (year / month dropdown) ── */
69
+ /* sh-ui Select 의 trigger 를 캘린더 헤더용으로 컴팩트하게 오버라이드 */
70
+
71
+ .calendar__select-trigger.select__trigger {
72
+ min-width: 0;
73
+ height: 1.75rem;
74
+ gap: var(--space-1);
75
+ padding: 0 var(--space-2);
76
+ background: transparent;
77
+ border-color: transparent;
78
+ font-weight: var(--weight-semibold);
79
+ font-size: var(--text-sm);
80
+ color: var(--foreground);
81
+ }
82
+
83
+ .calendar__select-trigger.select__trigger:hover:not(:disabled) {
84
+ background: var(--background-muted);
85
+ border-color: transparent;
86
+ }
87
+
88
+ .calendar__select-trigger.select__trigger[data-popup-open] {
89
+ background: var(--background-muted);
90
+ border-color: transparent;
91
+ }
92
+
93
+ /* popover 안의 캘린더에서도 dropdown 이 위로 올라오도록 z-index 보강.
94
+ * (Select 의 기본 z-dropdown=200 < z-popover=500 이므로 :has 로 캘린더 select 만 선택해 z-popover 로 끌어올림.) */
95
+ .select__positioner:has(.calendar__select-popup) {
96
+ z-index: var(--z-popover);
97
+ }
98
+
99
+ /* ── Weekdays ── */
100
+
101
+ .calendar__weekdays {
102
+ display: grid;
103
+ grid-template-columns: repeat(7, 1fr);
104
+ margin-bottom: var(--space-1);
105
+ }
106
+
107
+ .calendar__weekday {
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ height: 2rem;
112
+ font-size: var(--text-xs);
113
+ font-weight: var(--weight-medium);
114
+ color: var(--foreground-muted);
115
+ }
116
+
117
+ /* ── Grid ── */
118
+
119
+ .calendar__grid {
120
+ display: grid;
121
+ grid-template-columns: repeat(7, 1fr);
122
+ outline: none;
123
+ }
124
+
125
+ .calendar__grid:focus-visible {
126
+ outline: var(--border-width-strong) solid var(--foreground);
127
+ outline-offset: 2px;
128
+ border-radius: calc(var(--radius) - 2px);
129
+ }
130
+
131
+ /* ── Cell (column slot, range strip carrier) ── */
132
+
133
+ .calendar__cell {
134
+ display: flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+ width: 100%;
138
+ height: 2.375rem;
139
+ min-width: 0;
140
+ }
141
+
142
+ .calendar__cell--in-range,
143
+ .calendar__cell--range-start,
144
+ .calendar__cell--range-end {
145
+ background: color-mix(in srgb, var(--primary) 12%, transparent);
146
+ }
147
+
148
+ .calendar__cell--range-start:not(.calendar__cell--range-end) {
149
+ border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px);
150
+ }
151
+
152
+ .calendar__cell--range-end:not(.calendar__cell--range-start) {
153
+ border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0;
154
+ }
155
+
156
+ .calendar__cell--range-start.calendar__cell--range-end {
157
+ border-radius: calc(var(--radius) - 2px);
158
+ }
159
+
160
+ /* ── Day button ── */
161
+
162
+ .calendar__day {
163
+ display: flex;
164
+ align-items: center;
165
+ justify-content: center;
166
+ width: 2.25rem;
167
+ height: 2.25rem;
168
+ padding: 0;
169
+ border: none;
170
+ border-radius: calc(var(--radius) - 2px);
171
+ background: transparent;
172
+ color: var(--foreground);
173
+ font-size: 0.8125rem;
174
+ font-family: inherit;
175
+ cursor: pointer;
176
+ transition: background-color var(--duration-fast), color var(--duration-fast);
177
+ }
178
+
179
+ .calendar__day:hover:not(:disabled) {
180
+ background: var(--background-muted);
181
+ }
182
+
183
+ .calendar__day:focus-visible {
184
+ outline: var(--border-width-strong) solid var(--foreground);
185
+ outline-offset: 2px;
186
+ }
187
+
188
+ .calendar__day--outside {
189
+ color: var(--foreground-subtle, var(--foreground-muted));
190
+ opacity: 0.4;
191
+ }
192
+
193
+ .calendar__day--today {
194
+ font-weight: var(--weight-bold);
195
+ text-decoration: underline;
196
+ text-underline-offset: 0.125rem;
197
+ }
198
+
199
+ .calendar__day--selected {
200
+ background: var(--primary);
201
+ color: var(--primary-foreground);
202
+ font-weight: var(--weight-semibold);
203
+ }
204
+
205
+ .calendar__day--selected:hover:not(:disabled) {
206
+ background: var(--primary-hover);
207
+ color: var(--primary-foreground);
208
+ }
209
+
210
+ .calendar__day:disabled {
211
+ opacity: 0.3;
212
+ cursor: not-allowed;
213
+ }
@@ -0,0 +1,63 @@
1
+ import * as React from "react";
2
+ import { cn } from "@SH_UI_UTILS@";
3
+ import styles from "./styles.module.css";
4
+
5
+ type DivProps = React.HTMLAttributes<HTMLDivElement>;
6
+
7
+ export const Card = React.forwardRef<HTMLDivElement, DivProps>(
8
+ ({ className, ...props }, ref) => (
9
+ <div ref={ref} className={cn(styles.card, className)} {...props} />
10
+ ),
11
+ );
12
+ Card.displayName = "Card";
13
+
14
+ export const CardHeader = React.forwardRef<HTMLDivElement, DivProps>(
15
+ ({ className, ...props }, ref) => (
16
+ <div
17
+ ref={ref}
18
+ data-slot="card-header"
19
+ className={cn(styles.header, className)}
20
+ {...props}
21
+ />
22
+ ),
23
+ );
24
+ CardHeader.displayName = "CardHeader";
25
+
26
+ export const CardTitle = React.forwardRef<HTMLDivElement, DivProps>(
27
+ ({ className, ...props }, ref) => (
28
+ <div ref={ref} className={cn(styles.title, className)} {...props} />
29
+ ),
30
+ );
31
+ CardTitle.displayName = "CardTitle";
32
+
33
+ export const CardDescription = React.forwardRef<HTMLDivElement, DivProps>(
34
+ ({ className, ...props }, ref) => (
35
+ <div ref={ref} className={cn(styles.description, className)} {...props} />
36
+ ),
37
+ );
38
+ CardDescription.displayName = "CardDescription";
39
+
40
+ /**
41
+ * 헤더 우측에 배치되는 슬롯. CardHeader 내부에서 grid 2번째 컬럼을 차지.
42
+ * CardHeader가 `:has(.action)`으로 감지해 레이아웃을 전환한다.
43
+ */
44
+ export const CardAction = React.forwardRef<HTMLDivElement, DivProps>(
45
+ ({ className, ...props }, ref) => (
46
+ <div ref={ref} className={cn(styles.action, className)} {...props} />
47
+ ),
48
+ );
49
+ CardAction.displayName = "CardAction";
50
+
51
+ export const CardContent = React.forwardRef<HTMLDivElement, DivProps>(
52
+ ({ className, ...props }, ref) => (
53
+ <div ref={ref} className={cn(styles.content, className)} {...props} />
54
+ ),
55
+ );
56
+ CardContent.displayName = "CardContent";
57
+
58
+ export const CardFooter = React.forwardRef<HTMLDivElement, DivProps>(
59
+ ({ className, ...props }, ref) => (
60
+ <div ref={ref} className={cn(styles.footer, className)} {...props} />
61
+ ),
62
+ );
63
+ CardFooter.displayName = "CardFooter";
@@ -0,0 +1,73 @@
1
+ .card {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: var(--space-6);
5
+ padding: var(--space-6) 0;
6
+ background: var(--background);
7
+ color: var(--foreground);
8
+ border: 1px solid var(--border);
9
+ border-radius: var(--radius);
10
+ }
11
+
12
+ /* 헤더: 기본은 타이틀/설명 세로 스택. action 있으면 2열 그리드로 전환. */
13
+ .header {
14
+ display: grid;
15
+ grid-template-columns: 1fr;
16
+ grid-auto-rows: auto;
17
+ row-gap: 0.375rem;
18
+ padding: 0 var(--space-6);
19
+ }
20
+
21
+ .header:has(.action) {
22
+ grid-template-columns: 1fr auto;
23
+ }
24
+
25
+ .title {
26
+ font-size: var(--text-base);
27
+ font-weight: var(--weight-semibold);
28
+ line-height: 1.25;
29
+ letter-spacing: -0.01em;
30
+ }
31
+
32
+ .description {
33
+ font-size: var(--text-sm);
34
+ line-height: 1.5;
35
+ color: var(--foreground-muted);
36
+ }
37
+
38
+ .action {
39
+ grid-column: 2;
40
+ grid-row: 1 / span 2;
41
+ align-self: start;
42
+ justify-self: end;
43
+ }
44
+
45
+ .content {
46
+ padding: 0 var(--space-6);
47
+ font-size: var(--text-sm);
48
+ line-height: 1.6;
49
+ }
50
+
51
+ .footer {
52
+ padding: 0 var(--space-6);
53
+ display: flex;
54
+ align-items: center;
55
+ gap: var(--space-2);
56
+ }
57
+
58
+ /* 모바일: 패딩 축소 */
59
+ @media (max-width: 640px) {
60
+ .card {
61
+ gap: var(--space-4);
62
+ padding: var(--space-4) 0;
63
+ }
64
+ .header,
65
+ .content,
66
+ .footer {
67
+ padding-left: var(--space-4);
68
+ padding-right: var(--space-4);
69
+ }
70
+ .footer {
71
+ flex-wrap: wrap;
72
+ }
73
+ }