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,236 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { Select as BaseSelect } from "@base-ui-components/react/select";
5
+ import "./styles.css";
6
+
7
+ function cx(...args: (string | undefined | false)[]) {
8
+ return args.filter(Boolean).join(" ");
9
+ }
10
+
11
+ export const Select = BaseSelect.Root;
12
+
13
+ /** shadcn 호환: <SelectValue placeholder="..." /> */
14
+ export function SelectValue({
15
+ placeholder,
16
+ className,
17
+ ...props
18
+ }: { placeholder?: string; className?: string } & Omit<
19
+ React.ComponentPropsWithoutRef<typeof BaseSelect.Value>,
20
+ "children"
21
+ >) {
22
+ return (
23
+ <BaseSelect.Value className={cx("sh-ui-select__value", className)} {...props}>
24
+ {(value) =>
25
+ value !== null && value !== undefined && value !== "" ? (
26
+ (value as React.ReactNode)
27
+ ) : (
28
+ <span className="sh-ui-select__placeholder">{placeholder}</span>
29
+ )
30
+ }
31
+ </BaseSelect.Value>
32
+ );
33
+ }
34
+
35
+ export const SelectTrigger = React.forwardRef<
36
+ HTMLButtonElement,
37
+ Omit<React.ComponentPropsWithoutRef<typeof BaseSelect.Trigger>, "className"> & { className?: string }
38
+ >(({ className, children, ...props }, ref) => (
39
+ <BaseSelect.Trigger
40
+ ref={ref}
41
+ className={cx("sh-ui-select__trigger", className)}
42
+ {...props}
43
+ >
44
+ {children}
45
+ <BaseSelect.Icon className="sh-ui-select__icon" aria-hidden>
46
+ <svg viewBox="0 0 16 16" width="14" height="14" fill="none">
47
+ <path
48
+ d="M4 6l4 4 4-4"
49
+ stroke="currentColor"
50
+ strokeWidth="1.5"
51
+ strokeLinecap="round"
52
+ strokeLinejoin="round"
53
+ />
54
+ </svg>
55
+ </BaseSelect.Icon>
56
+ </BaseSelect.Trigger>
57
+ ));
58
+ SelectTrigger.displayName = "SelectTrigger";
59
+
60
+ /** Portal + Positioner + Popup을 한 번에.
61
+ * container: portal이 마운트될 DOM 노드. 기본 body. 토큰 스코프 안에 띄우려면 해당 컨테이너 ref 전달. */
62
+ export const SelectContent = React.forwardRef<
63
+ HTMLDivElement,
64
+ Omit<React.ComponentPropsWithoutRef<typeof BaseSelect.Popup>, "className"> & {
65
+ className?: string;
66
+ container?: React.ComponentPropsWithoutRef<typeof BaseSelect.Portal>["container"];
67
+ }
68
+ >(({ className, children, container, ...props }, ref) => (
69
+ <BaseSelect.Portal container={container}>
70
+ <BaseSelect.Positioner
71
+ className="sh-ui-select__positioner"
72
+ sideOffset={4}
73
+ align="start"
74
+ >
75
+ <BaseSelect.Popup
76
+ ref={ref}
77
+ className={cx("sh-ui-select__content", className)}
78
+ {...props}
79
+ >
80
+ {children}
81
+ </BaseSelect.Popup>
82
+ </BaseSelect.Positioner>
83
+ </BaseSelect.Portal>
84
+ ));
85
+ SelectContent.displayName = "SelectContent";
86
+
87
+ export const SelectGroup = BaseSelect.Group;
88
+
89
+ export const SelectLabel = React.forwardRef<
90
+ HTMLDivElement,
91
+ Omit<React.ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>, "className"> & { className?: string }
92
+ >(({ className, ...props }, ref) => (
93
+ <BaseSelect.GroupLabel
94
+ ref={ref}
95
+ className={cx("sh-ui-select__label", className)}
96
+ {...props}
97
+ />
98
+ ));
99
+ SelectLabel.displayName = "SelectLabel";
100
+
101
+ export const SelectItem = React.forwardRef<
102
+ HTMLDivElement,
103
+ Omit<React.ComponentPropsWithoutRef<typeof BaseSelect.Item>, "className"> & { className?: string }
104
+ >(({ className, children, ...props }, ref) => (
105
+ <BaseSelect.Item
106
+ ref={ref}
107
+ className={cx("sh-ui-select__item", className)}
108
+ {...props}
109
+ >
110
+ <BaseSelect.ItemIndicator className="sh-ui-select__indicator" aria-hidden>
111
+ <svg viewBox="0 0 16 16" width="14" height="14" fill="none">
112
+ <path
113
+ d="M3.5 8.5l3 3 6-7"
114
+ stroke="currentColor"
115
+ strokeWidth="1.75"
116
+ strokeLinecap="round"
117
+ strokeLinejoin="round"
118
+ />
119
+ </svg>
120
+ </BaseSelect.ItemIndicator>
121
+ <BaseSelect.ItemText className="sh-ui-select__item-text">
122
+ {children}
123
+ </BaseSelect.ItemText>
124
+ </BaseSelect.Item>
125
+ ));
126
+ SelectItem.displayName = "SelectItem";
127
+
128
+ export const SelectSeparator = React.forwardRef<
129
+ HTMLDivElement,
130
+ Omit<React.ComponentPropsWithoutRef<typeof BaseSelect.Separator>, "className"> & { className?: string }
131
+ >(({ className, ...props }, ref) => (
132
+ <BaseSelect.Separator
133
+ ref={ref}
134
+ className={cx("sh-ui-select__separator", className)}
135
+ {...props}
136
+ />
137
+ ));
138
+ SelectSeparator.displayName = "SelectSeparator";
139
+
140
+ /* ───────── Multi-select ─────────
141
+ *
142
+ * Base UI Select의 `multiple` 모드를 얇게 래핑한 것.
143
+ * Trigger/Content/Item/Group/Label/Separator는 그대로 재사용한다.
144
+ */
145
+
146
+ type BaseRootProps = React.ComponentPropsWithoutRef<typeof BaseSelect.Root>;
147
+
148
+ /** 칩 X 버튼 등에서 개별 항목을 제거할 수 있도록 MultiSelect 내부 상태를 expose한다. */
149
+ type MultiSelectCtx = {
150
+ values: string[];
151
+ remove: (value: string) => void;
152
+ clear: () => void;
153
+ };
154
+ const MultiSelectContext = React.createContext<MultiSelectCtx | null>(null);
155
+ export const useMultiSelect = () => {
156
+ const ctx = React.useContext(MultiSelectContext);
157
+ if (!ctx) throw new Error("useMultiSelect는 MultiSelect 하위에서만 사용할 수 있습니다.");
158
+ return ctx;
159
+ };
160
+
161
+ export const MultiSelect = React.forwardRef<
162
+ HTMLDivElement,
163
+ Omit<BaseRootProps, "multiple" | "value" | "defaultValue" | "onValueChange"> & {
164
+ value?: string[];
165
+ defaultValue?: string[];
166
+ onValueChange?: (value: string[]) => void;
167
+ }
168
+ >(({ value: valueProp, defaultValue, onValueChange, children, ...props }, _ref) => {
169
+ const isControlled = valueProp !== undefined;
170
+ const [internal, setInternal] = React.useState<string[]>(defaultValue ?? []);
171
+ const values = isControlled ? valueProp! : internal;
172
+
173
+ const commit = React.useCallback(
174
+ (next: string[]) => {
175
+ if (!isControlled) setInternal(next);
176
+ onValueChange?.(next);
177
+ },
178
+ [isControlled, onValueChange],
179
+ );
180
+
181
+ const ctx = React.useMemo<MultiSelectCtx>(
182
+ () => ({
183
+ values,
184
+ remove: (v) => commit(values.filter((x) => x !== v)),
185
+ clear: () => commit([]),
186
+ }),
187
+ [values, commit],
188
+ );
189
+
190
+ return (
191
+ <MultiSelectContext.Provider value={ctx}>
192
+ <BaseSelect.Root multiple value={values} onValueChange={commit} {...props}>
193
+ {children}
194
+ </BaseSelect.Root>
195
+ </MultiSelectContext.Provider>
196
+ );
197
+ });
198
+ MultiSelect.displayName = "MultiSelect";
199
+
200
+ /**
201
+ * 다중 선택 값 표시. 배열이 비면 placeholder, 있으면 join 또는 사용자 정의 renderer.
202
+ *
203
+ * <MultiSelectValue placeholder="과일" /> // "Apple, Banana"
204
+ * <MultiSelectValue placeholder="과일" render={(arr) => ...} /> // 커스텀 (칩 등)
205
+ */
206
+ export function MultiSelectValue({
207
+ placeholder,
208
+ render,
209
+ separator = ", ",
210
+ className,
211
+ ...props
212
+ }: {
213
+ placeholder?: string;
214
+ render?: (
215
+ values: string[],
216
+ handlers: { remove: (value: string) => void; clear: () => void },
217
+ ) => React.ReactNode;
218
+ separator?: string;
219
+ className?: string;
220
+ } & Omit<
221
+ React.ComponentPropsWithoutRef<typeof BaseSelect.Value>,
222
+ "children" | "render"
223
+ >) {
224
+ const { remove, clear } = useMultiSelect();
225
+ return (
226
+ <BaseSelect.Value className={cx("sh-ui-select__value", className)} {...props}>
227
+ {(value) => {
228
+ const arr = Array.isArray(value) ? (value as string[]) : [];
229
+ if (arr.length === 0) {
230
+ return <span className="sh-ui-select__placeholder">{placeholder}</span>;
231
+ }
232
+ return render ? render(arr, { remove, clear }) : arr.join(separator);
233
+ }}
234
+ </BaseSelect.Value>
235
+ );
236
+ }
@@ -0,0 +1,193 @@
1
+ .sh-ui-select__trigger {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ gap: var(--space-2);
6
+ min-width: 10rem;
7
+ height: var(--control-md);
8
+ padding: 0 var(--space-3);
9
+ background: var(--background);
10
+ color: var(--foreground);
11
+ border: 1px solid var(--border);
12
+ border-radius: var(--radius);
13
+ font-size: var(--text-sm);
14
+ line-height: 1;
15
+ cursor: pointer;
16
+ transition: border-color var(--duration-fast), background-color var(--duration-fast);
17
+ user-select: none;
18
+ -webkit-tap-highlight-color: transparent;
19
+ }
20
+
21
+ .sh-ui-select__trigger:hover:not(:disabled) {
22
+ border-color: var(--border-strong);
23
+ }
24
+
25
+ .sh-ui-select__trigger:focus-visible {
26
+ outline: var(--border-width-strong) solid var(--foreground);
27
+ outline-offset: 2px;
28
+ }
29
+
30
+ .sh-ui-select__trigger[data-popup-open] {
31
+ border-color: var(--border-strong);
32
+ }
33
+
34
+ .sh-ui-select__trigger:disabled {
35
+ opacity: var(--opacity-disabled);
36
+ pointer-events: none;
37
+ }
38
+
39
+ .sh-ui-select__value {
40
+ flex: 1 1 auto;
41
+ text-align: left;
42
+ overflow: hidden;
43
+ text-overflow: ellipsis;
44
+ white-space: nowrap;
45
+ }
46
+
47
+ .sh-ui-select__placeholder {
48
+ color: var(--foreground-subtle);
49
+ }
50
+
51
+ .sh-ui-select__icon {
52
+ display: inline-flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ color: var(--foreground-muted);
56
+ flex-shrink: 0;
57
+ transition: transform var(--duration-fast);
58
+ }
59
+
60
+ .sh-ui-select__trigger[data-popup-open] .sh-ui-select__icon {
61
+ transform: rotate(180deg);
62
+ }
63
+
64
+ /* 팝업 */
65
+ .sh-ui-select__positioner {
66
+ outline: none;
67
+ z-index: var(--z-dropdown);
68
+ }
69
+
70
+ .sh-ui-select__content {
71
+ min-width: var(--anchor-width, 10rem);
72
+ max-height: min(24rem, var(--available-height, 24rem));
73
+ overflow-y: auto;
74
+ padding: var(--space-1);
75
+ background: var(--background);
76
+ color: var(--foreground);
77
+ border: 1px solid var(--border);
78
+ border-radius: var(--radius);
79
+ box-shadow:
80
+ 0 4px 6px -1px rgba(0, 0, 0, 0.08),
81
+ 0 2px 4px -2px rgba(0, 0, 0, 0.05);
82
+ font-size: var(--text-sm);
83
+ transform-origin: var(--transform-origin);
84
+ animation: sh-ui-select-in 140ms ease-out;
85
+ }
86
+
87
+ .sh-ui-select__content[data-ending-style] {
88
+ animation: sh-ui-select-out 100ms ease-in forwards;
89
+ }
90
+
91
+ @keyframes sh-ui-select-in {
92
+ from { opacity: 0; transform: scale(0.96); }
93
+ to { opacity: 1; transform: scale(1); }
94
+ }
95
+ @keyframes sh-ui-select-out {
96
+ from { opacity: 1; transform: scale(1); }
97
+ to { opacity: 0; transform: scale(0.96); }
98
+ }
99
+
100
+ .sh-ui-select__label {
101
+ padding: var(--space-2) var(--space-2) var(--space-1);
102
+ font-size: var(--text-xs);
103
+ font-weight: var(--weight-semibold);
104
+ color: var(--foreground-muted);
105
+ text-transform: uppercase;
106
+ letter-spacing: 0.04em;
107
+ }
108
+
109
+ .sh-ui-select__item {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: var(--space-2);
113
+ padding: 0.5rem 0.75rem;
114
+ border-radius: calc(var(--radius) - 2px);
115
+ cursor: pointer;
116
+ outline: none;
117
+ user-select: none;
118
+ transition: background-color 80ms;
119
+ }
120
+
121
+ .sh-ui-select__item[data-highlighted],
122
+ .sh-ui-select__item:hover {
123
+ background: var(--background-muted);
124
+ }
125
+
126
+ .sh-ui-select__item[data-disabled] {
127
+ opacity: var(--opacity-disabled);
128
+ pointer-events: none;
129
+ }
130
+
131
+ .sh-ui-select__item-text {
132
+ flex: 1;
133
+ }
134
+
135
+ .sh-ui-select__indicator {
136
+ order: 1;
137
+ margin-left: auto;
138
+ display: inline-flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ color: var(--foreground);
142
+ }
143
+
144
+ .sh-ui-select__separator {
145
+ height: 1px;
146
+ background: var(--border);
147
+ margin: var(--space-1) 0;
148
+ }
149
+
150
+ /* 멀티 셀렉트 값 칩 (MultiSelectValue의 render prop에서 사용) */
151
+ .sh-ui-select__chips {
152
+ display: inline-flex;
153
+ align-items: center;
154
+ gap: var(--space-1);
155
+ flex-wrap: nowrap;
156
+ overflow: hidden;
157
+ }
158
+ .sh-ui-select__chip {
159
+ display: inline-flex;
160
+ align-items: center;
161
+ gap: var(--space-1);
162
+ padding: 0.125rem 0.375rem 0.125rem var(--space-2);
163
+ font-size: var(--text-xs);
164
+ line-height: 1.25rem;
165
+ background: var(--background-muted);
166
+ border-radius: calc(var(--radius) - 2px);
167
+ white-space: nowrap;
168
+ }
169
+
170
+ .sh-ui-select__chip-remove {
171
+ display: inline-flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ width: 1rem;
175
+ height: 1rem;
176
+ padding: 0;
177
+ border: 0;
178
+ border-radius: 999px;
179
+ background: transparent;
180
+ color: var(--foreground-muted);
181
+ font-size: var(--text-sm);
182
+ line-height: 1;
183
+ cursor: pointer;
184
+ transition: background-color var(--duration-fast), color var(--duration-fast);
185
+ }
186
+ .sh-ui-select__chip-remove:hover {
187
+ background: var(--background);
188
+ color: var(--foreground);
189
+ }
190
+ .sh-ui-select__chip-remove:focus-visible {
191
+ outline: var(--border-width-strong) solid var(--foreground);
192
+ outline-offset: 1px;
193
+ }
@@ -0,0 +1,48 @@
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
+ export type SeparatorOrientation = "horizontal" | "vertical";
9
+
10
+ export interface SeparatorProps
11
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, "role"> {
12
+ orientation?: SeparatorOrientation;
13
+ /**
14
+ * 의미 없는 시각적 구분선인지 여부. 기본 true(aria-hidden).
15
+ * 스크린리더에도 섹션 구분을 알려야 하면 false.
16
+ */
17
+ decorative?: boolean;
18
+ }
19
+
20
+ /**
21
+ * 시각적 구분선. 가로(height=1px) / 세로(width=1px).
22
+ *
23
+ * 의미 있는 구분에는 `decorative={false}`로 role=separator가 붙고, 그렇지 않으면
24
+ * aria-hidden 처리되어 보조 기술에 노출되지 않는다.
25
+ */
26
+ export const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(
27
+ function Separator(
28
+ { className, orientation = "horizontal", decorative = true, ...props },
29
+ ref,
30
+ ) {
31
+ return (
32
+ <div
33
+ ref={ref}
34
+ role={decorative ? undefined : "separator"}
35
+ aria-orientation={decorative ? undefined : orientation}
36
+ aria-hidden={decorative || undefined}
37
+ data-orientation={orientation}
38
+ className={cx(
39
+ "sh-ui-separator",
40
+ `sh-ui-separator--${orientation}`,
41
+ className,
42
+ )}
43
+ {...props}
44
+ />
45
+ );
46
+ },
47
+ );
48
+ Separator.displayName = "Separator";
@@ -0,0 +1,15 @@
1
+ .sh-ui-separator {
2
+ background: var(--border);
3
+ flex-shrink: 0;
4
+ }
5
+
6
+ .sh-ui-separator--horizontal {
7
+ width: 100%;
8
+ height: 1px;
9
+ }
10
+
11
+ .sh-ui-separator--vertical {
12
+ width: 1px;
13
+ height: 100%;
14
+ align-self: stretch;
15
+ }