sh-ui-cli 0.49.0 → 0.51.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.
- package/data/changelog/versions.json +27 -0
- package/data/registry/react/components/accordion/index.vanilla-extract.tsx +97 -0
- package/data/registry/react/components/accordion/styles.css.ts +131 -0
- package/data/registry/react/components/avatar/index.vanilla-extract.tsx +73 -0
- package/data/registry/react/components/avatar/styles.css.ts +68 -0
- package/data/registry/react/components/badge/index.vanilla-extract.tsx +40 -0
- package/data/registry/react/components/badge/styles.css.ts +71 -0
- package/data/registry/react/components/breadcrumb/index.vanilla-extract.tsx +152 -0
- package/data/registry/react/components/breadcrumb/styles.css.ts +95 -0
- package/data/registry/react/components/calendar/index.vanilla-extract.tsx +806 -0
- package/data/registry/react/components/calendar/styles.css.ts +250 -0
- package/data/registry/react/components/carousel/index.vanilla-extract.tsx +430 -0
- package/data/registry/react/components/carousel/styles.css.ts +169 -0
- package/data/registry/react/components/checkbox/index.vanilla-extract.tsx +96 -0
- package/data/registry/react/components/checkbox/styles.css.ts +74 -0
- package/data/registry/react/components/code-editor/index.vanilla-extract.tsx +230 -0
- package/data/registry/react/components/code-editor/styles.css.ts +97 -0
- package/data/registry/react/components/code-panel/index.vanilla-extract.tsx +191 -0
- package/data/registry/react/components/code-panel/styles.css.ts +151 -0
- package/data/registry/react/components/color-picker/index.vanilla-extract.tsx +467 -0
- package/data/registry/react/components/color-picker/styles.css.ts +169 -0
- package/data/registry/react/components/combobox/index.vanilla-extract.tsx +165 -0
- package/data/registry/react/components/combobox/styles.css.ts +174 -0
- package/data/registry/react/components/context-menu/index.vanilla-extract.tsx +251 -0
- package/data/registry/react/components/context-menu/styles.css.ts +167 -0
- package/data/registry/react/components/date-picker/index.vanilla-extract.tsx +520 -0
- package/data/registry/react/components/date-picker/styles.css.ts +111 -0
- package/data/registry/react/components/dialog/index.vanilla-extract.tsx +95 -0
- package/data/registry/react/components/dialog/styles.css.ts +140 -0
- package/data/registry/react/components/dropdown-menu/index.vanilla-extract.tsx +255 -0
- package/data/registry/react/components/dropdown-menu/styles.css.ts +175 -0
- package/data/registry/react/components/file-upload/index.vanilla-extract.tsx +487 -0
- package/data/registry/react/components/file-upload/styles.css.ts +193 -0
- package/data/registry/react/components/form/index.vanilla-extract.tsx +61 -0
- package/data/registry/react/components/form/styles.css.ts +56 -0
- package/data/registry/react/components/header/index.vanilla-extract.tsx +805 -0
- package/data/registry/react/components/header/styles.css.ts +413 -0
- package/data/registry/react/components/label/index.vanilla-extract.tsx +52 -0
- package/data/registry/react/components/label/styles.css.ts +141 -0
- package/data/registry/react/components/markdown-editor/index.vanilla-extract.tsx +119 -0
- package/data/registry/react/components/markdown-editor/styles.css.ts +231 -0
- package/data/registry/react/components/menubar/index.vanilla-extract.tsx +32 -0
- package/data/registry/react/components/menubar/styles.css.ts +53 -0
- package/data/registry/react/components/numeric-input/index.vanilla-extract.tsx +148 -0
- package/data/registry/react/components/numeric-input/styles.css.ts +65 -0
- package/data/registry/react/components/page-toc/index.vanilla-extract.tsx +174 -0
- package/data/registry/react/components/page-toc/styles.css.ts +97 -0
- package/data/registry/react/components/pagination/index.vanilla-extract.tsx +269 -0
- package/data/registry/react/components/pagination/styles.css.ts +113 -0
- package/data/registry/react/components/popover/index.vanilla-extract.tsx +113 -0
- package/data/registry/react/components/popover/styles.css.ts +78 -0
- package/data/registry/react/components/progress/index.vanilla-extract.tsx +54 -0
- package/data/registry/react/components/progress/styles.css.ts +53 -0
- package/data/registry/react/components/radio/index.vanilla-extract.tsx +65 -0
- package/data/registry/react/components/radio/styles.css.ts +79 -0
- package/data/registry/react/components/rich-text-editor/index.vanilla-extract.tsx +348 -0
- package/data/registry/react/components/rich-text-editor/styles.css.ts +243 -0
- package/data/registry/react/components/select/index.vanilla-extract.tsx +234 -0
- package/data/registry/react/components/select/styles.css.ts +225 -0
- package/data/registry/react/components/separator/index.vanilla-extract.tsx +46 -0
- package/data/registry/react/components/separator/styles.css.ts +24 -0
- package/data/registry/react/components/sidebar/index.vanilla-extract.tsx +1067 -0
- package/data/registry/react/components/sidebar/styles.css.ts +578 -0
- package/data/registry/react/components/skeleton/index.vanilla-extract.tsx +22 -0
- package/data/registry/react/components/skeleton/styles.css.ts +30 -0
- package/data/registry/react/components/slider/index.vanilla-extract.tsx +298 -0
- package/data/registry/react/components/slider/styles.css.ts +75 -0
- package/data/registry/react/components/spinner/index.vanilla-extract.tsx +38 -0
- package/data/registry/react/components/spinner/styles.css.ts +60 -0
- package/data/registry/react/components/switch/index.vanilla-extract.tsx +39 -0
- package/data/registry/react/components/switch/styles.css.ts +87 -0
- package/data/registry/react/components/tabs/index.vanilla-extract.tsx +91 -0
- package/data/registry/react/components/tabs/styles.css.ts +145 -0
- package/data/registry/react/components/textarea/index.vanilla-extract.tsx +23 -0
- package/data/registry/react/components/textarea/styles.css.ts +55 -0
- package/data/registry/react/components/toast/index.vanilla-extract.tsx +258 -0
- package/data/registry/react/components/toast/styles.css.ts +307 -0
- package/data/registry/react/components/toggle/index.vanilla-extract.tsx +131 -0
- package/data/registry/react/components/toggle/styles.css.ts +109 -0
- package/data/registry/react/components/tooltip/index.vanilla-extract.tsx +83 -0
- package/data/registry/react/components/tooltip/styles.css.ts +59 -0
- package/data/registry/react/registry.json +853 -36
- package/package.json +1 -1
- package/src/api.d.ts +4 -3
- package/src/constants.js +4 -3
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
|
|
3
|
+
export const fileUpload = style({
|
|
4
|
+
display: "flex",
|
|
5
|
+
flexDirection: "column",
|
|
6
|
+
gap: "var(--space-3)",
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const fileUploadDropzone = style({
|
|
10
|
+
position: "relative",
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: "column",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
gap: "var(--space-2)",
|
|
16
|
+
padding: "var(--space-8) var(--space-6)",
|
|
17
|
+
minHeight: "10rem",
|
|
18
|
+
background: "var(--background-subtle)",
|
|
19
|
+
color: "var(--foreground-muted)",
|
|
20
|
+
border: "1.5px dashed var(--border)",
|
|
21
|
+
borderRadius: "var(--radius)",
|
|
22
|
+
cursor: "pointer",
|
|
23
|
+
textAlign: "center",
|
|
24
|
+
transition: "border-color var(--duration-fast), background-color var(--duration-fast), color var(--duration-fast)",
|
|
25
|
+
WebkitTapHighlightColor: "transparent",
|
|
26
|
+
selectors: {
|
|
27
|
+
"&:hover": {
|
|
28
|
+
borderColor: "var(--border-strong)",
|
|
29
|
+
color: "var(--foreground)",
|
|
30
|
+
},
|
|
31
|
+
"&:focus-visible": {
|
|
32
|
+
outline: "var(--border-width-strong) solid var(--foreground)",
|
|
33
|
+
outlineOffset: "2px",
|
|
34
|
+
borderColor: "var(--foreground)",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const fileUploadDropzoneDrag = style({
|
|
40
|
+
borderColor: "var(--foreground)",
|
|
41
|
+
background: "var(--background-muted)",
|
|
42
|
+
color: "var(--foreground)",
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const fileUploadDropzoneDisabled = style({
|
|
46
|
+
opacity: "var(--opacity-disabled)",
|
|
47
|
+
cursor: "not-allowed",
|
|
48
|
+
pointerEvents: "none",
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const fileUploadInput = style({
|
|
52
|
+
position: "absolute",
|
|
53
|
+
width: "1px",
|
|
54
|
+
height: "1px",
|
|
55
|
+
padding: 0,
|
|
56
|
+
margin: "-1px",
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
clip: "rect(0 0 0 0)",
|
|
59
|
+
whiteSpace: "nowrap",
|
|
60
|
+
border: 0,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const fileUploadText = style({
|
|
64
|
+
fontSize: "var(--text-sm)",
|
|
65
|
+
color: "var(--foreground)",
|
|
66
|
+
selectors: {
|
|
67
|
+
"& strong": {
|
|
68
|
+
fontWeight: "var(--weight-semibold)",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const fileUploadHint = style({
|
|
74
|
+
fontSize: "var(--text-xs)",
|
|
75
|
+
color: "var(--foreground-muted)",
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const fileUploadTrigger = style({
|
|
79
|
+
display: "inline-flex",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
gap: "var(--space-2)",
|
|
83
|
+
padding: "var(--space-2) var(--space-3)",
|
|
84
|
+
fontSize: "var(--text-sm)",
|
|
85
|
+
fontWeight: "var(--weight-medium)",
|
|
86
|
+
color: "var(--foreground)",
|
|
87
|
+
background: "var(--background)",
|
|
88
|
+
border: "1px solid var(--border)",
|
|
89
|
+
borderRadius: "calc(var(--radius) - 2px)",
|
|
90
|
+
cursor: "pointer",
|
|
91
|
+
transition: "background-color var(--duration-fast), border-color var(--duration-fast)",
|
|
92
|
+
selectors: {
|
|
93
|
+
"&:hover:not(:disabled)": {
|
|
94
|
+
background: "var(--background-muted)",
|
|
95
|
+
borderColor: "var(--border-strong)",
|
|
96
|
+
},
|
|
97
|
+
"&:focus-visible": {
|
|
98
|
+
outline: "var(--border-width-strong) solid var(--foreground)",
|
|
99
|
+
outlineOffset: "2px",
|
|
100
|
+
},
|
|
101
|
+
"&:disabled": {
|
|
102
|
+
opacity: "var(--opacity-disabled)",
|
|
103
|
+
cursor: "not-allowed",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export const fileUploadList = style({
|
|
109
|
+
listStyle: "none",
|
|
110
|
+
margin: 0,
|
|
111
|
+
padding: 0,
|
|
112
|
+
display: "flex",
|
|
113
|
+
flexDirection: "column",
|
|
114
|
+
gap: "0.375rem",
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const fileUploadItem = style({
|
|
118
|
+
display: "flex",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
gap: "0.625rem",
|
|
121
|
+
padding: "var(--space-2) var(--space-3)",
|
|
122
|
+
background: "var(--background)",
|
|
123
|
+
border: "1px solid var(--border)",
|
|
124
|
+
borderRadius: "calc(var(--radius) - 2px)",
|
|
125
|
+
fontSize: "var(--text-sm)",
|
|
126
|
+
color: "var(--foreground)",
|
|
127
|
+
selectors: {
|
|
128
|
+
"& > svg": {
|
|
129
|
+
color: "var(--foreground-muted)",
|
|
130
|
+
flexShrink: 0,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export const fileUploadName = style({
|
|
136
|
+
flex: "1 1 auto",
|
|
137
|
+
overflow: "hidden",
|
|
138
|
+
textOverflow: "ellipsis",
|
|
139
|
+
whiteSpace: "nowrap",
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export const fileUploadSize = style({
|
|
143
|
+
fontSize: "var(--text-xs)",
|
|
144
|
+
color: "var(--foreground-muted)",
|
|
145
|
+
flexShrink: 0,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
export const fileUploadRemove = style({
|
|
149
|
+
display: "inline-flex",
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
justifyContent: "center",
|
|
152
|
+
width: "1.5rem",
|
|
153
|
+
height: "1.5rem",
|
|
154
|
+
padding: 0,
|
|
155
|
+
background: "transparent",
|
|
156
|
+
border: "none",
|
|
157
|
+
borderRadius: "calc(var(--radius) - 4px)",
|
|
158
|
+
color: "var(--foreground-muted)",
|
|
159
|
+
cursor: "pointer",
|
|
160
|
+
transition: "color var(--duration-fast), background-color var(--duration-fast)",
|
|
161
|
+
flexShrink: 0,
|
|
162
|
+
selectors: {
|
|
163
|
+
"&:hover:not(:disabled)": {
|
|
164
|
+
color: "var(--foreground)",
|
|
165
|
+
background: "var(--background-muted)",
|
|
166
|
+
},
|
|
167
|
+
"&:focus-visible": {
|
|
168
|
+
outline: "var(--border-width-strong) solid var(--foreground)",
|
|
169
|
+
outlineOffset: "2px",
|
|
170
|
+
},
|
|
171
|
+
"&:disabled": {
|
|
172
|
+
opacity: "var(--opacity-disabled)",
|
|
173
|
+
cursor: "not-allowed",
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
/** 동적 키로 클래스 참조용 — `byKey[\`badge--${variant}\`]` 같은 패턴 지원. */
|
|
179
|
+
export const byKey: Record<string, string> = {
|
|
180
|
+
"file-upload": fileUpload,
|
|
181
|
+
"file-upload__dropzone": fileUploadDropzone,
|
|
182
|
+
"file-upload__dropzone--drag": fileUploadDropzoneDrag,
|
|
183
|
+
"file-upload__dropzone--disabled": fileUploadDropzoneDisabled,
|
|
184
|
+
"file-upload__input": fileUploadInput,
|
|
185
|
+
"file-upload__text": fileUploadText,
|
|
186
|
+
"file-upload__hint": fileUploadHint,
|
|
187
|
+
"file-upload__trigger": fileUploadTrigger,
|
|
188
|
+
"file-upload__list": fileUploadList,
|
|
189
|
+
"file-upload__item": fileUploadItem,
|
|
190
|
+
"file-upload__name": fileUploadName,
|
|
191
|
+
"file-upload__size": fileUploadSize,
|
|
192
|
+
"file-upload__remove": fileUploadRemove,
|
|
193
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { byKey, form, formSection, formField, formError } from "./styles.css";
|
|
4
|
+
import { Form as FormRoot, Section, SectionTitle } from "./form";
|
|
5
|
+
import {
|
|
6
|
+
Field,
|
|
7
|
+
FormLabel,
|
|
8
|
+
FormDescription,
|
|
9
|
+
FormError,
|
|
10
|
+
FormControl,
|
|
11
|
+
} from "./field";
|
|
12
|
+
import { Steps, Step } from "./steps";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* sh-ui Form의 compound 진입점. `Form.Field`, `Form.Label`, `Form.Description`,
|
|
16
|
+
* `Form.Error`, `Form.Control`, `Form.Section`, `Form.SectionTitle`, `Form.Steps`, `Form.Step` 으로
|
|
17
|
+
* 구조를 조립한다. 검증은 Standard Schema(yup/zod 등) 또는 inline 함수로 부착한다.
|
|
18
|
+
*/
|
|
19
|
+
type FormType = typeof FormRoot & {
|
|
20
|
+
Section: typeof Section;
|
|
21
|
+
SectionTitle: typeof SectionTitle;
|
|
22
|
+
Field: typeof Field;
|
|
23
|
+
Label: typeof FormLabel;
|
|
24
|
+
Description: typeof FormDescription;
|
|
25
|
+
Error: typeof FormError;
|
|
26
|
+
Control: typeof FormControl;
|
|
27
|
+
Steps: typeof Steps;
|
|
28
|
+
Step: typeof Step;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const Form = FormRoot as FormType;
|
|
32
|
+
Form.Section = Section;
|
|
33
|
+
Form.SectionTitle = SectionTitle;
|
|
34
|
+
Form.Field = Field;
|
|
35
|
+
Form.Label = FormLabel;
|
|
36
|
+
Form.Description = FormDescription;
|
|
37
|
+
Form.Error = FormError;
|
|
38
|
+
Form.Control = FormControl;
|
|
39
|
+
Form.Steps = Steps;
|
|
40
|
+
Form.Step = Step;
|
|
41
|
+
|
|
42
|
+
export { Form };
|
|
43
|
+
export { useShUiForm } from "./use-sh-ui-form";
|
|
44
|
+
export {
|
|
45
|
+
useFormContext,
|
|
46
|
+
useFormField,
|
|
47
|
+
useFormSection,
|
|
48
|
+
useFormState,
|
|
49
|
+
} from "./context";
|
|
50
|
+
export { useFormSteps } from "./steps";
|
|
51
|
+
export { createFormStore } from "./store";
|
|
52
|
+
export type {
|
|
53
|
+
FormStore,
|
|
54
|
+
FormStoreState,
|
|
55
|
+
FieldState,
|
|
56
|
+
FieldError,
|
|
57
|
+
FieldConfig,
|
|
58
|
+
FieldValidate,
|
|
59
|
+
ValidateOn,
|
|
60
|
+
StandardSchemaV1,
|
|
61
|
+
} from "./types";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { style, keyframes } from "@vanilla-extract/css";
|
|
2
|
+
|
|
3
|
+
export const shUiFormErrorIn = keyframes({
|
|
4
|
+
"from": {
|
|
5
|
+
opacity: 0,
|
|
6
|
+
transform: "translateY(-4px)",
|
|
7
|
+
},
|
|
8
|
+
"to": {
|
|
9
|
+
opacity: 1,
|
|
10
|
+
transform: "translateY(0)",
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const form = style({
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
gap: "var(--space-4, 1rem)",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const formSection = style({
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
gap: "var(--space-4, 1rem)",
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const formField = style({
|
|
27
|
+
display: "flex",
|
|
28
|
+
flexDirection: "column",
|
|
29
|
+
gap: "var(--space-1, 0.25rem)",
|
|
30
|
+
selectors: {
|
|
31
|
+
"&[data-disabled]": {
|
|
32
|
+
opacity: 0.6,
|
|
33
|
+
pointerEvents: "none",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const formError = style({
|
|
39
|
+
color: "var(--color-danger, #dc2626)",
|
|
40
|
+
fontSize: "var(--text-sm, 0.875rem)",
|
|
41
|
+
margin: 0,
|
|
42
|
+
animation: "sh-ui-form-error-in 150ms\n var(--easing-out, cubic-bezier(0.16, 1, 0.3, 1))",
|
|
43
|
+
"@media": {
|
|
44
|
+
"(prefers-reduced-motion: reduce)": {
|
|
45
|
+
animationDuration: "0.01ms",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/** 동적 키로 클래스 참조용 — `byKey[\`badge--${variant}\`]` 같은 패턴 지원. */
|
|
51
|
+
export const byKey: Record<string, string> = {
|
|
52
|
+
"form": form,
|
|
53
|
+
"form-section": formSection,
|
|
54
|
+
"form-field": formField,
|
|
55
|
+
"form-error": formError,
|
|
56
|
+
};
|