@xfilecom/front-core 0.2.27 → 0.2.29

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 (53) hide show
  1. package/README.md +45 -15
  2. package/dist/base.css +756 -0
  3. package/dist/components/atoms/Accordion.d.ts +18 -0
  4. package/dist/components/atoms/Accordion.js +68 -0
  5. package/dist/components/atoms/Alert.d.ts +12 -0
  6. package/dist/components/atoms/Alert.js +24 -0
  7. package/dist/components/atoms/AspectRatio.d.ts +8 -0
  8. package/dist/components/atoms/AspectRatio.js +10 -0
  9. package/dist/components/atoms/Avatar.d.ts +22 -0
  10. package/dist/components/atoms/Avatar.js +32 -0
  11. package/dist/components/atoms/Breadcrumb.d.ts +15 -0
  12. package/dist/components/atoms/Breadcrumb.js +27 -0
  13. package/dist/components/atoms/Collapsible.d.ts +12 -0
  14. package/dist/components/atoms/Collapsible.js +42 -0
  15. package/dist/components/atoms/Label.d.ts +8 -0
  16. package/dist/components/atoms/Label.js +10 -0
  17. package/dist/components/atoms/Pagination.d.ts +13 -0
  18. package/dist/components/atoms/Pagination.js +25 -0
  19. package/dist/components/atoms/Paper.d.ts +16 -0
  20. package/dist/components/atoms/Paper.js +13 -0
  21. package/dist/components/atoms/Progress.d.ts +8 -0
  22. package/dist/components/atoms/Progress.js +9 -0
  23. package/dist/components/atoms/RadioGroup.d.ts +15 -0
  24. package/dist/components/atoms/RadioGroup.js +37 -0
  25. package/dist/components/atoms/ScrollArea.d.ts +8 -0
  26. package/dist/components/atoms/ScrollArea.js +15 -0
  27. package/dist/components/atoms/Separator.d.ts +10 -0
  28. package/dist/components/atoms/Separator.js +17 -0
  29. package/dist/components/atoms/Skeleton.d.ts +6 -0
  30. package/dist/components/atoms/Skeleton.js +15 -0
  31. package/dist/components/atoms/Slider.d.ts +4 -0
  32. package/dist/components/atoms/Slider.js +9 -0
  33. package/dist/components/atoms/Switch.d.ts +10 -0
  34. package/dist/components/atoms/Switch.js +12 -0
  35. package/dist/components/atoms/Table.d.ts +20 -0
  36. package/dist/components/atoms/Table.js +38 -0
  37. package/dist/components/atoms/Tabs.d.ts +20 -0
  38. package/dist/components/atoms/Tabs.js +54 -0
  39. package/dist/components/atoms/Toggle.d.ts +8 -0
  40. package/dist/components/atoms/Toggle.js +23 -0
  41. package/dist/components/atoms/Tooltip.d.ts +10 -0
  42. package/dist/components/atoms/Tooltip.js +12 -0
  43. package/dist/components/atoms/index.d.ts +23 -3
  44. package/dist/components/atoms/index.js +78 -7
  45. package/dist/generatedVersion.d.ts +1 -1
  46. package/dist/generatedVersion.js +1 -1
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +52 -1
  49. package/dist/tokens.css +6 -0
  50. package/docs/COMPONENTS.md +137 -0
  51. package/docs/DESIGN_SYSTEM.md +32 -0
  52. package/docs/SHADCN.md +66 -0
  53. package/package.json +4 -2
@@ -0,0 +1,137 @@
1
+ # Components reference
2
+
3
+ 소스는 모두 `packages/front-core/src/` 기준. 빌드 산출물은 `dist/`에 동일 구조로 복사된다.
4
+
5
+ ## 레이아웃·표면
6
+
7
+ | 컴포넌트 | 소스 | 요약 |
8
+ |----------|------|------|
9
+ | `Paper` | [atoms/Paper.tsx](../src/components/atoms/Paper.tsx) | `elevation` 0~4, `variant` filled \| outlined |
10
+ | `Card` | [atoms/Card.tsx](../src/components/atoms/Card.tsx) | `title`, `footer`, `interactive` |
11
+ | `Box` | [atoms/Box.tsx](../src/components/atoms/Box.tsx) | `as`, `padding` |
12
+ | `Stack` | [atoms/Stack.tsx](../src/components/atoms/Stack.tsx) | flex gap·align·justify |
13
+
14
+ ### Paper
15
+
16
+ ```tsx
17
+ import { Paper, Stack, Text } from '@xfilecom/front-core';
18
+
19
+ <Paper elevation={2} style={{ padding: 'var(--xfc-space-lg)' }}>
20
+ <Text variant="body">Elevation 2 surface</Text>
21
+ </Paper>
22
+
23
+ <Paper variant="outlined" style={{ padding: 'var(--xfc-space-md)' }}>
24
+ Border only
25
+ </Paper>
26
+ ```
27
+
28
+ ### Card
29
+
30
+ ```tsx
31
+ import { Card, Button } from '@xfilecom/front-core';
32
+
33
+ <Card
34
+ title="제목"
35
+ footer={<Button variant="primary">확인</Button>}
36
+ >
37
+ 본문
38
+ </Card>
39
+ ```
40
+
41
+ ## 타이포
42
+
43
+ | 컴포넌트 | 소스 |
44
+ |----------|------|
45
+ | `Text` | [atoms/Text.tsx](../src/components/atoms/Text.tsx) |
46
+
47
+ `variant`: `title` | `appbar` | `section` | `subtitle` | `lead` | `body` | `muted` | `small` | `label` | `labelBlock` | `accent`
48
+
49
+ ```tsx
50
+ <Text variant="section">섹션 제목</Text>
51
+ <Text variant="lead">리드 문단</Text>
52
+ ```
53
+
54
+ ## 액션
55
+
56
+ | 컴포넌트 | 소스 |
57
+ |----------|------|
58
+ | `Button` | [atoms/Button.tsx](../src/components/atoms/Button.tsx) |
59
+ | `Badge` | [atoms/Badge.tsx](../src/components/atoms/Badge.tsx) |
60
+
61
+ `Button` variants: `primary` | `secondary` | `outline` | `muted` | `ghost`
62
+ `Badge` tone: `neutral` | `accent` | `success` | `warn` | `danger`
63
+
64
+ ## 폼
65
+
66
+ | 컴포넌트 | 소스 |
67
+ |----------|------|
68
+ | `Input` | [atoms/Input.tsx](../src/components/atoms/Input.tsx) |
69
+ | `Textarea` | [atoms/Textarea.tsx](../src/components/atoms/Textarea.tsx) |
70
+ | `Select` | [atoms/Select.tsx](../src/components/atoms/Select.tsx) |
71
+ | `Checkbox` | [atoms/Checkbox.tsx](../src/components/atoms/Checkbox.tsx) |
72
+ | `Field` | [atoms/Field.tsx](../src/components/atoms/Field.tsx) |
73
+
74
+ `Field`는 **단일** 자식에 `id` / `aria-describedby` / `aria-invalid`를 병합한다. `htmlFor`와 자식 `id`를 일치시킨다.
75
+
76
+ ## 피드백
77
+
78
+ | 컴포넌트 | 소스 |
79
+ |----------|------|
80
+ | `Toast` / `ToastList` | [atoms/Toast.tsx](../src/components/atoms/Toast.tsx) |
81
+ | `ToastSeverityIcon` | 동일 파일 |
82
+ | `InlineErrorList` | [atoms/InlineErrorList.tsx](../src/components/atoms/InlineErrorList.tsx) |
83
+ | `LoadingOverlay` | [atoms/LoadingOverlay.tsx](../src/components/atoms/LoadingOverlay.tsx) |
84
+
85
+ `ToastList`의 `ToastEntry`에 `dismissible?: boolean`으로 행마다 닫기 버튼을 제어한다.
86
+
87
+ ## 오버레이
88
+
89
+ | 컴포넌트 | 소스 |
90
+ |----------|------|
91
+ | `Dialog` | [overlays/Dialog.tsx](../src/components/overlays/Dialog.tsx) |
92
+ | `ConfirmDialog` | [overlays/ConfirmDialog.tsx](../src/components/overlays/ConfirmDialog.tsx) |
93
+ | `BottomSheet` | [overlays/BottomSheet.tsx](../src/components/overlays/BottomSheet.tsx) |
94
+
95
+ 커스텀 모달에 동일한 스크롤 잠금·포커스 트랩을 쓰려면 [overlayHooks.ts](../src/components/overlays/overlayHooks.ts)의 `useFocusTrap`, `useBodyScrollLock`, `useEscapeKey`를 루트에서 import 한다.
96
+
97
+ ## shadcn/ui 스타일 원자
98
+
99
+ [SHADCN.md](./SHADCN.md)에 **전체 매핑표**(캘린더·콤보박스 등 앱 의존 항목 포함)가 있다. 아래는 패키지에 포함된 대응 컴포넌트 요약.
100
+
101
+ | 이름 | 소스 |
102
+ |------|------|
103
+ | `Separator` | [atoms/Separator.tsx](../src/components/atoms/Separator.tsx) |
104
+ | `Skeleton` | [atoms/Skeleton.tsx](../src/components/atoms/Skeleton.tsx) |
105
+ | `Label` | [atoms/Label.tsx](../src/components/atoms/Label.tsx) |
106
+ | `Switch` | [atoms/Switch.tsx](../src/components/atoms/Switch.tsx) |
107
+ | `Progress` | [atoms/Progress.tsx](../src/components/atoms/Progress.tsx) |
108
+ | `Tabs` · `TabsList` · `TabsTrigger` · `TabsContent` | [atoms/Tabs.tsx](../src/components/atoms/Tabs.tsx) |
109
+ | `Accordion` · … | [atoms/Accordion.tsx](../src/components/atoms/Accordion.tsx) |
110
+ | `Alert` · `AlertTitle` · `AlertDescription` | [atoms/Alert.tsx](../src/components/atoms/Alert.tsx) |
111
+ | `Avatar` · `AvatarImage` · `AvatarFallback` · `AvatarAuto` | [atoms/Avatar.tsx](../src/components/atoms/Avatar.tsx) |
112
+ | `Breadcrumb` · … | [atoms/Breadcrumb.tsx](../src/components/atoms/Breadcrumb.tsx) |
113
+ | `Table` · … | [atoms/Table.tsx](../src/components/atoms/Table.tsx) |
114
+ | `ScrollArea` | [atoms/ScrollArea.tsx](../src/components/atoms/ScrollArea.tsx) |
115
+ | `Toggle` | [atoms/Toggle.tsx](../src/components/atoms/Toggle.tsx) |
116
+ | `RadioGroup` · `RadioGroupItem` | [atoms/RadioGroup.tsx](../src/components/atoms/RadioGroup.tsx) |
117
+ | `AspectRatio` | [atoms/AspectRatio.tsx](../src/components/atoms/AspectRatio.tsx) |
118
+ | `Tooltip` | [atoms/Tooltip.tsx](../src/components/atoms/Tooltip.tsx) |
119
+ | `Collapsible` · … | [atoms/Collapsible.tsx](../src/components/atoms/Collapsible.tsx) |
120
+ | `Slider` | [atoms/Slider.tsx](../src/components/atoms/Slider.tsx) |
121
+ | `Pagination` · … | [atoms/Pagination.tsx](../src/components/atoms/Pagination.tsx) |
122
+
123
+ ## CSS
124
+
125
+ | 파일 | 용도 |
126
+ |------|------|
127
+ | [tokens.css](../src/tokens.css) | `:root` 변수, 다크 프리셋 |
128
+ | [base.css](../src/base.css) | `.xfc-*` atoms 스타일 |
129
+
130
+ ## TypeScript
131
+
132
+ `tokenVars`로 CSS 변수 이름을 문자열 상수로 참조할 수 있다. ([index.ts](../src/index.ts))
133
+
134
+ ```ts
135
+ import { tokenVars } from '@xfilecom/front-core';
136
+ document.body.style.setProperty(tokenVars.colorAccent, '#143c38');
137
+ ```
@@ -0,0 +1,32 @@
1
+ # xframe design system vs Paper-style UI kits
2
+
3
+ `@xfilecom/front-core`는 **브라우저 전용**이며 React Native(`react-native-paper`)나 MUI(`@mui/material`)와 동일한 패키지는 아니다. 대신 **같은 UX 패턴**(표면·높이·토큰)을 웹 CSS 변수 + 얇은 React atoms로 옮긴다.
4
+
5
+ ## 한눈에 비교
6
+
7
+ | 개념 | MUI (`Paper`) | react-native-paper (`Surface`) | front-core |
8
+ |------|---------------|---------------------------------|------------|
9
+ | 표면/카드 | `Paper` + `elevation` | `Surface` + `elevation` | [`Paper`](../src/components/atoms/Paper.tsx) `elevation={0…4}` |
10
+ | 구조형 카드 | `Card` | `Card` | [`Card`](../src/components/atoms/Card.tsx) (title/footer 슬롯) |
11
+ | 버튼 | `Button` | `Button` | [`Button`](../src/components/atoms/Button.tsx) variants |
12
+ | 다이얼로그 | `Dialog` | `Portal`+`Dialog` | [`Dialog`](../src/components/overlays/Dialog.tsx) |
13
+ | 스낵바/토스트 | `Snackbar` | `Snackbar` | [`Toast`](../src/components/atoms/Toast.tsx) / [`ToastList`](../src/components/atoms/Toast.tsx) |
14
+ | 테마 | `ThemeProvider` | `PaperProvider` | `:root` / `html.dark` **CSS 변수** + 선택적 `xfc-theme.css` |
15
+
16
+ ## Elevation (높이)
17
+
18
+ - **MUI**: 그림자 깊이가 elevation 숫자에 대응.
19
+ - **front-core**: `Paper`의 `elevation` 0~4가 `--xfc-shadow-xs` … `--xfc-shadow-lg`에 매핑된다. `variant="outlined"`는 그림자 없이 테두리만 (`outlined` variant).
20
+
21
+ ## 색 (Color roles)
22
+
23
+ Material 3의 *primary / on-primary / surface* 같은 **역할 이름**은 npm 타입으로 강제하지 않고, `--xfc-accent`, `--xfc-bg-elevated`, `--xfc-fg` 등 **토큰 이름**으로 맞춘다. 다크 모드는 `html.dark` 또는 `data-theme="dark"` 한 번에 같은 변수를 덮어쓴다.
24
+
25
+ ## 언제 MUI / RN Paper를 쓰고 언제 front-core를 쓰나
26
+
27
+ - **이미 MUI 생태계**를 쓰는 앱 → MUI 유지.
28
+ - **xframe 스캐폴드**, 번들·의존성을 가볍게, Nest와 무관한 **순수 웹 atoms** → `front-core`.
29
+
30
+ ## 다음 문서
31
+
32
+ - [COMPONENTS.md](./COMPONENTS.md) — 컴포넌트별 props·소스 경로·예제 코드
package/docs/SHADCN.md ADDED
@@ -0,0 +1,66 @@
1
+ # shadcn/ui 대응표
2
+
3
+ [shadcn/ui](https://ui.shadcn.com/)는 **Radix UI + Tailwind** 기반의 복사-붙여넣기 컴포넌트 모음이다. `@xfilecom/front-core`는 **Radix·Tailwind 없이** 동일한 **역할·이름에 가까운** API를 토큰(`--xfc-*`) + `base.css`로 제공한다. 고급 포지셔닝(드롭다운 앵커, 날짜 그리드 등)은 앱에서 전용 라이브러리를 쓰는 것을 권장한다.
4
+
5
+ ## 컴포넌트 매핑
6
+
7
+ | shadcn | front-core | 비고 |
8
+ |--------|------------|------|
9
+ | Accordion | `Accordion`, `AccordionItem`, `AccordionTrigger`, `AccordionContent` | single 전용; multiple는 추후 확장 가능 |
10
+ | Alert | `Alert`, `AlertTitle`, `AlertDescription` | |
11
+ | Alert Dialog | `ConfirmDialog` | 문구·버튼 props로 조합 |
12
+ | Aspect Ratio | `AspectRatio` | |
13
+ | Avatar | `Avatar`, `AvatarImage`, `AvatarFallback`, `AvatarAuto` | 이미지+대체는 `AvatarAuto` 권장 |
14
+ | Badge | `Badge` | tone API는 shadcn과 다름 |
15
+ | Breadcrumb | `Breadcrumb`, `BreadcrumbList`, … | |
16
+ | Button | `Button` | variant 이름 다름 (`primary` 등) |
17
+ | Calendar | — | 앱에서 `react-day-picker` 등 |
18
+ | Card | `Card`, `Paper` | `Card`는 헤더/푸터 패턴 |
19
+ | Carousel | — | 앱에서 embla 등 |
20
+ | Chart | — | 앱에서 recharts 등 |
21
+ | Checkbox | `Checkbox` | |
22
+ | Collapsible | `Collapsible`, `CollapsibleTrigger`, `CollapsibleContent` | |
23
+ | Combobox | — | `Select` + 앱 로직 또는 외부 라이브러리 |
24
+ | Command | — | 앱에서 cmdk 등 |
25
+ | Context Menu | — | 앱에서 Radix 등 |
26
+ | Data Table | `Table` + 앱 | 정렬·페이지네이션은 앱 상태 |
27
+ | Date Picker | — | 앱에서 date 라이브러리 |
28
+ | Dialog | `Dialog` | |
29
+ | Drawer | `BottomSheet` | 모바일 퍼스트 시트 |
30
+ | Dropdown Menu | — | 앱에서 Radix Menu 등 |
31
+ | Form | `Field` + 앱 검증 | react-hook-form 등과 조합 |
32
+ | Hover Card | — | `Tooltip` 단순 버전 또는 Radix |
33
+ | Input | `Input` | |
34
+ | Input OTP | — | 앱 전용 |
35
+ | Label | `Label` | `Field`와 병행 가능 |
36
+ | Menubar | — | |
37
+ | Navigation Menu | — | |
38
+ | Pagination | `Pagination`, `PaginationContent`, `PaginationLink`, … | |
39
+ | Popover | — | `Dialog` 소형 또는 Radix |
40
+ | Progress | `Progress` | |
41
+ | Radio Group | `RadioGroup`, `RadioGroupItem` | |
42
+ | Resizable | — | |
43
+ | Scroll Area | `ScrollArea` | 네이티브 스크롤 |
44
+ | Select | `Select` | 네이티브 `<select>` 스타일 |
45
+ | Separator | `Separator` | |
46
+ | Sheet | `BottomSheet` / `Dialog` | |
47
+ | Skeleton | `Skeleton` | |
48
+ | Slider | `Slider` | 네이티브 `range` |
49
+ | Sonner / Toast | `Toast`, `ToastList` | |
50
+ | Switch | `Switch` | |
51
+ | Table | `Table`, `TableHeader`, `TableBody`, … | |
52
+ | Tabs | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` | |
53
+ | Textarea | `Textarea` | |
54
+ | Toggle | `Toggle` | |
55
+ | Toggle Group | — | `Toggle` 여러 개 + 앱 상태 |
56
+ | Tooltip | `Tooltip` | 인라인 단순 툴팁 |
57
+
58
+ ## 스타일·접근성
59
+
60
+ - 포커스 링: `base.css`의 `--xfc-focus-ring` 계열.
61
+ - 다크: `tokens.css` — `html.dark` / `data-theme="dark"`.
62
+ - shadcn과 **클래스 이름은 다름** — 마이그레이션 시 JSX만 교체하고 앱 `app.css`에서 보정한다.
63
+
64
+ ## 소스 위치
65
+
66
+ 신규 원자는 `src/components/atoms/*.tsx` (예: `Tabs.tsx`, `Table.tsx`). 스타일은 `src/base.css`의 **shadcn/ui-style primitives** 블록.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfilecom/front-core",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "description": "Shared design tokens, base CSS, and atomic React components (browser-only; no Nest dependency)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,7 +21,9 @@
21
21
  }
22
22
  },
23
23
  "files": [
24
- "dist"
24
+ "dist",
25
+ "docs",
26
+ "README.md"
25
27
  ],
26
28
  "scripts": {
27
29
  "prepublishOnly": "npm run build",