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.
- package/data/changelog/versions.json +26 -0
- package/data/registry/react/components/accordion/index.module.tsx +97 -0
- package/data/registry/react/components/accordion/styles.module.css +111 -0
- package/data/registry/react/components/avatar/index.module.tsx +73 -0
- package/data/registry/react/components/avatar/styles.module.css +36 -0
- package/data/registry/react/components/badge/index.module.tsx +40 -0
- package/data/registry/react/components/badge/styles.module.css +57 -0
- package/data/registry/react/components/breadcrumb/index.module.tsx +152 -0
- package/data/registry/react/components/breadcrumb/styles.module.css +82 -0
- package/data/registry/react/components/button/index.module.tsx +45 -0
- package/data/registry/react/components/button/styles.module.css +92 -0
- package/data/registry/react/components/calendar/index.module.tsx +806 -0
- package/data/registry/react/components/calendar/styles.module.css +213 -0
- package/data/registry/react/components/card/index.module.tsx +63 -0
- package/data/registry/react/components/card/styles.module.css +73 -0
- package/data/registry/react/components/carousel/index.module.tsx +430 -0
- package/data/registry/react/components/carousel/styles.module.css +155 -0
- package/data/registry/react/components/checkbox/index.module.tsx +96 -0
- package/data/registry/react/components/checkbox/styles.module.css +75 -0
- package/data/registry/react/components/code-editor/index.module.tsx +230 -0
- package/data/registry/react/components/code-editor/styles.module.css +76 -0
- package/data/registry/react/components/code-panel/index.module.tsx +191 -0
- package/data/registry/react/components/code-panel/styles.module.css +124 -0
- package/data/registry/react/components/color-picker/index.module.tsx +467 -0
- package/data/registry/react/components/color-picker/styles.module.css +166 -0
- package/data/registry/react/components/combobox/index.module.tsx +165 -0
- package/data/registry/react/components/combobox/styles.module.css +151 -0
- package/data/registry/react/components/context-menu/index.module.tsx +251 -0
- package/data/registry/react/components/context-menu/styles.module.css +140 -0
- package/data/registry/react/components/date-picker/index.module.tsx +520 -0
- package/data/registry/react/components/date-picker/styles.module.css +103 -0
- package/data/registry/react/components/dialog/index.module.tsx +95 -0
- package/data/registry/react/components/dialog/styles.module.css +127 -0
- package/data/registry/react/components/dropdown-menu/index.module.tsx +255 -0
- package/data/registry/react/components/dropdown-menu/styles.module.css +150 -0
- package/data/registry/react/components/file-upload/index.module.tsx +487 -0
- package/data/registry/react/components/file-upload/styles.module.css +170 -0
- package/data/registry/react/components/form/index.module.tsx +61 -0
- package/data/registry/react/components/form/styles.module.css +47 -0
- package/data/registry/react/components/header/index.module.tsx +805 -0
- package/data/registry/react/components/header/styles.module.css +350 -0
- package/data/registry/react/components/input/index.module.tsx +486 -0
- package/data/registry/react/components/input/styles.module.css +200 -0
- package/data/registry/react/components/label/index.module.tsx +52 -0
- package/data/registry/react/components/label/styles.module.css +90 -0
- package/data/registry/react/components/markdown-editor/index.module.tsx +119 -0
- package/data/registry/react/components/markdown-editor/styles.module.css +160 -0
- package/data/registry/react/components/menubar/index.module.tsx +32 -0
- package/data/registry/react/components/menubar/styles.module.css +45 -0
- package/data/registry/react/components/numeric-input/index.module.tsx +148 -0
- package/data/registry/react/components/numeric-input/styles.module.css +56 -0
- package/data/registry/react/components/page-toc/index.module.tsx +174 -0
- package/data/registry/react/components/page-toc/styles.module.css +82 -0
- package/data/registry/react/components/pagination/index.module.tsx +269 -0
- package/data/registry/react/components/pagination/styles.module.css +105 -0
- package/data/registry/react/components/popover/index.module.tsx +113 -0
- package/data/registry/react/components/popover/styles.module.css +65 -0
- package/data/registry/react/components/progress/index.module.tsx +54 -0
- package/data/registry/react/components/progress/styles.module.css +41 -0
- package/data/registry/react/components/radio/index.module.tsx +65 -0
- package/data/registry/react/components/radio/styles.module.css +80 -0
- package/data/registry/react/components/rich-text-editor/index.module.tsx +348 -0
- package/data/registry/react/components/rich-text-editor/styles.module.css +196 -0
- package/data/registry/react/components/select/index.module.tsx +234 -0
- package/data/registry/react/components/select/styles.module.css +193 -0
- package/data/registry/react/components/separator/index.module.tsx +46 -0
- package/data/registry/react/components/separator/styles.module.css +15 -0
- package/data/registry/react/components/sidebar/index.module.tsx +1067 -0
- package/data/registry/react/components/sidebar/styles.module.css +502 -0
- package/data/registry/react/components/skeleton/index.module.tsx +22 -0
- package/data/registry/react/components/skeleton/styles.module.css +24 -0
- package/data/registry/react/components/slider/index.module.tsx +298 -0
- package/data/registry/react/components/slider/styles.module.css +64 -0
- package/data/registry/react/components/spinner/index.module.tsx +38 -0
- package/data/registry/react/components/spinner/styles.module.css +37 -0
- package/data/registry/react/components/switch/index.module.tsx +39 -0
- package/data/registry/react/components/switch/styles.module.css +83 -0
- package/data/registry/react/components/tabs/index.module.tsx +91 -0
- package/data/registry/react/components/tabs/styles.module.css +148 -0
- package/data/registry/react/components/textarea/index.module.tsx +23 -0
- package/data/registry/react/components/textarea/styles.module.css +54 -0
- package/data/registry/react/components/toast/index.module.tsx +258 -0
- package/data/registry/react/components/toast/styles.module.css +290 -0
- package/data/registry/react/components/toggle/index.module.tsx +131 -0
- package/data/registry/react/components/toggle/styles.module.css +85 -0
- package/data/registry/react/components/tooltip/index.module.tsx +83 -0
- package/data/registry/react/components/tooltip/styles.module.css +44 -0
- package/data/registry/react/registry.json +604 -1
- package/data/tokens/build.mjs +4 -0
- package/package.json +1 -1
- package/src/add.mjs +12 -12
- package/src/api.d.ts +4 -3
- package/src/constants.js +4 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "@SH_UI_UTILS@";
|
|
3
|
+
import styles from "./styles.module.css";
|
|
4
|
+
|
|
5
|
+
type Variant = "primary" | "secondary" | "ghost" | "danger" | "link";
|
|
6
|
+
type Size = "sm" | "md" | "lg";
|
|
7
|
+
|
|
8
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
/**
|
|
10
|
+
* 시각적 위계.
|
|
11
|
+
* - `primary` — 페이지의 주요 액션. 한 화면에 하나만 권장.
|
|
12
|
+
* - `secondary` — 보조 액션. 약한 배경 + border.
|
|
13
|
+
* - `ghost` — 배경 없는 hover 강조 액션. 툴바/메뉴 항목에 적합.
|
|
14
|
+
* - `danger` — 파괴적 액션(삭제, 취소 등).
|
|
15
|
+
* - `link` — 텍스트 링크처럼 보이는 인라인 버튼.
|
|
16
|
+
*
|
|
17
|
+
* @default "primary"
|
|
18
|
+
*/
|
|
19
|
+
variant?: Variant;
|
|
20
|
+
/**
|
|
21
|
+
* 크기.
|
|
22
|
+
* - `sm` — 조밀한 영역(테이블 행, 툴바)
|
|
23
|
+
* - `md` — 일반
|
|
24
|
+
* - `lg` — CTA·랜딩 영역
|
|
25
|
+
*
|
|
26
|
+
* @default "md"
|
|
27
|
+
*/
|
|
28
|
+
size?: Size;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 사용자 액션을 트리거하는 기본 버튼 (CSS Modules 변종).
|
|
33
|
+
* variant로 시각적 위계(primary/secondary/ghost/danger/link)를,
|
|
34
|
+
* size로 크기를 결정한다. 페이지 이동 목적이면 anchor를 감싼 `link` variant를 사용할 것.
|
|
35
|
+
*/
|
|
36
|
+
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
37
|
+
({ variant = "primary", size = "md", className, ...props }, ref) => (
|
|
38
|
+
<button
|
|
39
|
+
ref={ref}
|
|
40
|
+
className={cn(styles.button, styles[variant], styles[size], className)}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
Button.displayName = "Button";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: var(--space-2);
|
|
6
|
+
border: 1px solid transparent;
|
|
7
|
+
border-radius: var(--radius);
|
|
8
|
+
font-weight: var(--weight-medium);
|
|
9
|
+
line-height: 1;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
transition: background-color var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast),
|
|
12
|
+
transform 80ms ease-out, filter 80ms;
|
|
13
|
+
user-select: none;
|
|
14
|
+
-webkit-tap-highlight-color: transparent;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.button:disabled {
|
|
18
|
+
opacity: var(--opacity-disabled);
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.button:focus-visible {
|
|
23
|
+
outline: var(--border-width-strong) solid var(--foreground);
|
|
24
|
+
outline-offset: 2px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.button:active:not(:disabled) {
|
|
28
|
+
transform: scale(0.97);
|
|
29
|
+
filter: brightness(0.92);
|
|
30
|
+
transition-duration: 40ms;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* sizes */
|
|
34
|
+
.sm { height: var(--control-sm); padding: 0 var(--space-3); font-size: var(--text-sm); }
|
|
35
|
+
.md { height: var(--control-md); padding: 0 var(--space-4); font-size: var(--text-sm); }
|
|
36
|
+
.lg { height: var(--control-lg); padding: 0 var(--space-5); font-size: var(--text-base); }
|
|
37
|
+
|
|
38
|
+
/* 모바일/터치 디바이스: 최소 탭 영역 보장 */
|
|
39
|
+
@media (hover: none) and (pointer: coarse) {
|
|
40
|
+
.sm { height: 2.25rem; }
|
|
41
|
+
.md { height: 2.75rem; }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* variants */
|
|
45
|
+
.primary {
|
|
46
|
+
background-color: var(--primary);
|
|
47
|
+
color: var(--primary-foreground);
|
|
48
|
+
}
|
|
49
|
+
.primary:hover { background-color: var(--primary-hover); }
|
|
50
|
+
|
|
51
|
+
.secondary {
|
|
52
|
+
background-color: var(--background-muted);
|
|
53
|
+
color: var(--foreground);
|
|
54
|
+
border-color: var(--border);
|
|
55
|
+
}
|
|
56
|
+
.secondary:hover { background-color: var(--background-subtle); }
|
|
57
|
+
|
|
58
|
+
.ghost {
|
|
59
|
+
background-color: transparent;
|
|
60
|
+
color: var(--foreground);
|
|
61
|
+
}
|
|
62
|
+
.ghost:hover { background-color: var(--background-muted); }
|
|
63
|
+
|
|
64
|
+
.danger {
|
|
65
|
+
background-color: var(--danger);
|
|
66
|
+
color: var(--danger-foreground);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.link {
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
color: var(--foreground);
|
|
72
|
+
border-color: transparent;
|
|
73
|
+
height: auto;
|
|
74
|
+
padding: 0;
|
|
75
|
+
text-underline-offset: 3px;
|
|
76
|
+
}
|
|
77
|
+
.link:hover { text-decoration: underline; }
|
|
78
|
+
.link:active:not(:disabled) {
|
|
79
|
+
transform: none;
|
|
80
|
+
filter: none;
|
|
81
|
+
color: var(--foreground-muted);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (prefers-reduced-motion: reduce) {
|
|
85
|
+
.button {
|
|
86
|
+
transition: none;
|
|
87
|
+
}
|
|
88
|
+
.button:active:not(:disabled) {
|
|
89
|
+
transform: none;
|
|
90
|
+
filter: none;
|
|
91
|
+
}
|
|
92
|
+
}
|