@uniai-fe/uds-primitives 0.0.7 → 0.0.8

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 (56) hide show
  1. package/README.md +64 -5
  2. package/dist/styles.css +236 -279
  3. package/package.json +4 -4
  4. package/src/components/badge/markup/Badge.tsx +10 -0
  5. package/src/components/badge/styles/index.scss +2 -2
  6. package/src/components/badge/types/index.ts +1 -1
  7. package/src/components/button/index.scss +3 -1
  8. package/src/components/button/index.tsx +9 -1
  9. package/src/components/button/markup/ButtonDefault.tsx +162 -0
  10. package/src/components/button/markup/ButtonRounded.tsx +48 -0
  11. package/src/components/button/markup/ButtonText.tsx +49 -0
  12. package/src/components/button/markup/index.ts +3 -0
  13. package/src/components/button/styles/{index.scss → button.scss} +148 -362
  14. package/src/components/button/styles/round-button.scss +56 -0
  15. package/src/components/button/styles/text-button.scss +96 -0
  16. package/src/components/button/types/index.ts +110 -35
  17. package/src/components/button/types/templates.ts +33 -0
  18. package/src/components/button/utils/index.ts +19 -19
  19. package/src/components/checkbox/markup/Checkbox.tsx +20 -2
  20. package/src/components/checkbox/types/checkbox.ts +16 -0
  21. package/src/components/chip/markup/Chip.tsx +8 -0
  22. package/src/components/dialog/markup/{confirm-dialog.tsx → ConfirmDialog.tsx} +23 -0
  23. package/src/components/dialog/markup/{notice-dialog.tsx → NoticeDialog.tsx} +18 -0
  24. package/src/components/dialog/markup/index.tsx +2 -2
  25. package/src/components/dialog/types/index.ts +43 -0
  26. package/src/components/drawer/markup/{drawer.tsx → Drawer.tsx} +58 -0
  27. package/src/components/drawer/markup/index.tsx +1 -1
  28. package/src/components/drawer/types/index.ts +24 -0
  29. package/src/components/input/markup/text/Base.tsx +32 -3
  30. package/src/components/input/markup/text/Identification.tsx +15 -2
  31. package/src/components/input/markup/text/Password.tsx +35 -2
  32. package/src/components/input/markup/text/Phone.tsx +38 -2
  33. package/src/components/input/markup/text/Search.tsx +30 -1
  34. package/src/components/input/styles/index.scss +6 -6
  35. package/src/components/input/types/index.ts +22 -1
  36. package/src/components/input/utils/index.ts +6 -0
  37. package/src/components/navigation/markup/mobile/BottomNavigation.tsx +11 -0
  38. package/src/components/navigation/types/index.ts +22 -0
  39. package/src/components/pagination/markup/Carousel.tsx +1 -0
  40. package/src/components/pagination/markup/Count.tsx +1 -0
  41. package/src/components/pagination/markup/Pagination.tsx +2 -0
  42. package/src/components/radio/markup/Radio.tsx +16 -2
  43. package/src/components/radio/markup/RadioCard.tsx +8 -0
  44. package/src/components/radio/markup/RadioCardGroup.tsx +8 -0
  45. package/src/components/radio/types/radio.ts +39 -0
  46. package/src/components/segmented-control/markup/SegmentedControl.tsx +12 -0
  47. package/src/components/segmented-control/types/index.ts +16 -0
  48. package/src/components/tab/markup/TabContent.tsx +5 -0
  49. package/src/components/tab/markup/TabList.tsx +19 -2
  50. package/src/components/tab/markup/TabRoot.tsx +50 -4
  51. package/src/components/tab/markup/TabTrigger.tsx +9 -1
  52. package/src/components/tab/styles/index.scss +28 -10
  53. package/src/components/tab/types/index.ts +10 -0
  54. package/src/components/tab/utils/tab-context.ts +8 -2
  55. package/src/components/button/markup/Button.tsx +0 -175
  56. package/src/components/button/markup/index.tsx +0 -1
package/README.md CHANGED
@@ -39,10 +39,69 @@ import "@uniai-fe/uds-foundation/css";
39
39
  import { Button } from "@uniai-fe/uds-primitives";
40
40
 
41
41
  export default function Page() {
42
- return <Button intent="primary">확인</Button>;
42
+ return (
43
+ <Button.Default scale="solid-medium" priority="primary">
44
+ 확인
45
+ </Button.Default>
46
+ );
47
+ }
48
+ ```
49
+
50
+ ### Link/Anchor로 사용하기
51
+
52
+ ```tsx
53
+ import Link from "next/link";
54
+ import { Button } from "@uniai-fe/uds-primitives";
55
+
56
+ function LinkButton() {
57
+ return (
58
+ <Button.Default
59
+ as={Link}
60
+ href="/dashboard"
61
+ scale="outlined-medium"
62
+ priority="secondary"
63
+ >
64
+ 대시보드로 이동
65
+ </Button.Default>
66
+ );
67
+ }
68
+ ```
69
+
70
+ ### Button 역할 클래스 & Props 미리보기
71
+
72
+ - 기본 클래스: `.button` (padding/height/radius/타이포/커서 담당)
73
+ - 슬롯: `button-label`, `button-icon`, `button-left`, `button-right`, `button-loading`
74
+ - Modifier: `button-scale-*`, `button-fill-*`, `button-priority-*`, `button-state-*`, `button-size-*`, `button-block`, `button-icon-left/right`
75
+ - 차기 리팩토링에서는 디자인 관련 props를 `scale`(레이아웃/spacing 집합)과 `priority`(color set) 두 축으로 단순화하고, 나머지는 상태/slot 위주의 역할 props만 남긴다. 자세한 계획은 `docs/CONTEXT-BUTTON.md`에서 확인할 수 있다.
76
+ - `loading` 상태는 readonly와 동일하게 잠기며 hover/pressed 반응을 막는다. anchor 등 커스텀 요소도 `aria-disabled="true"`를 통해 동일한 스타일을 적용받는다.
77
+
78
+ ### TextButton / RoundButton 템플릿
79
+
80
+ `Button` 객체는 템플릿별 컴포넌트를 포함한다.
81
+
82
+ ```tsx
83
+ import { Button } from "@uniai-fe/uds-primitives";
84
+
85
+ function Templates() {
86
+ return (
87
+ <>
88
+ <Button.Text priority="secondary" size="medium">
89
+ 링크 스타일
90
+ </Button.Text>
91
+
92
+ <Button.Rounded aria-label="추가" size="small">
93
+ <span aria-hidden="true">+</span>
94
+ </Button.Rounded>
95
+ </>
96
+ );
43
97
  }
44
98
  ```
45
99
 
100
+ - TextButton(`Button.Text`)은 `size="small|medium|large"` + `priority="secondary|tertiary"`만 허용한다.
101
+ - RoundButton(`Button.Rounded`)은 size만 지정하면 되고 priority는 기본 Button과 동일하게 `primary|secondary|tertiary`를 사용한다.
102
+ - 템플릿별 클래스를 추가로 노출한다: `.button-template-text`, `.button-template-text-size-*`, `.button-template-round`, `.button-template-round-size-*`.
103
+ - 스토리북 `primitives/Button` Story에서 solid/outlined/텍스트/라운드 4가지 카테고리를 한 번에 확인할 수 있다.
104
+
46
105
  ## 스타일 내보내기
47
106
 
48
107
  `@uniai-fe/uds-primitives/styles` 엔트리를 import하면 foundation CSS, theme override, 컴포넌트 SCSS가 한 번에 로드된다.
@@ -60,8 +119,8 @@ import "@uniai-fe/uds-primitives/css";
60
119
  컴포넌트 단위로 필요한 스타일만 선택해 불러오려면 각 경로(`components/{name}/index.scss`)를 직접 import하면 된다.
61
120
 
62
121
  ```scss
63
- @use "@uniai-fe/uds-primitives/components/button/index.scss";
64
- @use "@uniai-fe/uds-primitives/components/navigation/index.scss";
122
+ @use "@uniai-fe/uds-primitives/button/index.scss";
123
+ @use "@uniai-fe/uds-primitives/navigation/index.scss";
65
124
  ```
66
125
 
67
126
  ThemeProvider는 CSS를 import하지 않으므로 위 styles 엔트리를 앱 루트에서 1회만 로드하면 중복 없이 토큰 매핑이 적용된다.
@@ -107,7 +166,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
107
166
 
108
167
  위 예시는 ThemeProvider가 CSS를 다시 import하지 않는 현재 구조를 기준으로 하므로, `globals.scss` 또는 루트에서 styles/css 엔트리를 반드시 한 번 로드해야 한다. Sass 기반 프로젝트는 `@use "@uniai-fe/uds-primitives/styles";`, CSS-only 프로젝트는 `import "@uniai-fe/uds-primitives/css";`를 사용한다.
109
168
 
110
- 모든 컴포넌트는 `className`/`data-*` 기반으로 override가 가능하며, 내부 슬롯(prefix/suffix/iconSlot 등) `CONTEXT-*.md`에 정의된 API를 따릅니다.
169
+ 모든 컴포넌트는 `.component` 클래스 + CSS 변수 기반으로 override가 가능하며, 버튼처럼 Slot(left/right/icon 등) 제공하는 항목은 `CONTEXT-*.md` 문서에 상세 API를 기록했습니다. 불필요한 `data-*` attribute는 제거했고, 상태 표시는 `:disabled`, `[aria-busy="true"]` 같은 표준 attribute만 사용합니다.
111
170
 
112
171
  ## 구조
113
172
 
@@ -120,7 +179,7 @@ src/components/{category}/
120
179
  ```
121
180
 
122
181
  - 배럴(`components/{category}/index.tsx`)은 항상 `import "./index.scss"`를 포함합니다.
123
- - 스타일은 foundation CSS 변수만 사용하며, Radix 기본 클래스 대신 `.button[data-intent=...]` 형태로 분기합니다.
182
+ - 스타일은 foundation CSS 변수만 사용하며, `.button.button-priority-*` / `.button.button-fill-*` 클래스 조합으로 상태를 분기합니다.
124
183
 
125
184
  ## 스크립트
126
185