@exem-ui/react 0.3.4-next.20260701100258 → 0.3.4-next.20260702065311
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/README.en.md +4 -3
- package/README.md +18 -4
- package/dist/code-editor/index.d.mts +141 -0
- package/dist/code-editor/index.d.ts +141 -0
- package/dist/code-editor/index.js +987 -0
- package/dist/code-editor/index.js.map +1 -0
- package/dist/code-editor/index.mjs +965 -0
- package/dist/code-editor/index.mjs.map +1 -0
- package/package.json +21 -3
- package/styles.css +69 -0
package/README.en.md
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
## Key Features
|
|
25
25
|
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
26
|
+
- **23 Component Categories** — Enterprise-grade components including Button, Modal, Tabs, Table, Toast
|
|
27
|
+
- **200+ Icons** — Auto-generated React icon components from SVG sources
|
|
28
28
|
- **Accessibility First** — WAI-ARIA compliant, built on Radix UI primitives
|
|
29
29
|
- **Compound Component Pattern** — Intuitive composition API like `Modal.Header`, `Tabs.Content`
|
|
30
30
|
- **High-performance Table** — Virtual scrolling powered by TanStack Table + Virtual
|
|
@@ -109,8 +109,9 @@ Import from `@exem-ui/react`. Icons are imported from `@exem-ui/react/icon`.
|
|
|
109
109
|
| Breadcrumb | Navigation breadcrumb |
|
|
110
110
|
| Button | Button (variant, size) |
|
|
111
111
|
| Checkbox | Checkbox |
|
|
112
|
+
| CodeEditor | SQL/JSON code viewer and light editing |
|
|
112
113
|
| Flat | Flat list |
|
|
113
|
-
| Icon |
|
|
114
|
+
| Icon | 200+ icons (`@exem-ui/react/icon`) |
|
|
114
115
|
| Input | Text input |
|
|
115
116
|
| Loading | Loading indicator |
|
|
116
117
|
| MessageBox | Message box |
|
package/README.md
CHANGED
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
## 주요 특징
|
|
25
25
|
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
26
|
+
- **23개 컴포넌트 카테고리** — Button, Modal, Tabs, Table, Toast 등 엔터프라이즈급 컴포넌트
|
|
27
|
+
- **200+ 아이콘** — SVG에서 자동 생성되는 React 아이콘 컴포넌트
|
|
28
28
|
- **접근성 우선** — Radix UI 기반으로 WAI-ARIA 패턴 준수
|
|
29
29
|
- **Compound Component 패턴** — `Modal.Header`, `Tabs.Content` 등 직관적 조합 API
|
|
30
30
|
- **고성능 테이블** — TanStack Table + Virtual 기반 가상 스크롤링 지원
|
|
@@ -118,6 +118,19 @@ function App() {
|
|
|
118
118
|
}
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
+
### CodeEditor
|
|
122
|
+
|
|
123
|
+
CodeEditor는 Monaco 기반 optional 컴포넌트라 별도 서브패스에서 import합니다.
|
|
124
|
+
Monaco worker 설정은 사용처의 번들러/Monaco 설정을 따릅니다.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
pnpm add monaco-editor @monaco-editor/react
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import { CodeEditor } from "@exem-ui/react/code-editor";
|
|
132
|
+
```
|
|
133
|
+
|
|
121
134
|
### 아이콘
|
|
122
135
|
|
|
123
136
|
```tsx
|
|
@@ -136,7 +149,7 @@ function Nav() {
|
|
|
136
149
|
|
|
137
150
|
## 컴포넌트 목록
|
|
138
151
|
|
|
139
|
-
`@exem-ui/react`에서 import합니다.
|
|
152
|
+
기본 컴포넌트는 `@exem-ui/react`에서 import합니다. 아이콘은 `@exem-ui/react/icon`, CodeEditor는 `@exem-ui/react/code-editor`에서 import합니다.
|
|
140
153
|
|
|
141
154
|
| 컴포넌트 | 설명 |
|
|
142
155
|
| ---------- | ------------------------------------ |
|
|
@@ -145,8 +158,9 @@ function Nav() {
|
|
|
145
158
|
| Breadcrumb | 탐색 경로 |
|
|
146
159
|
| Button | 버튼 (variant, size) |
|
|
147
160
|
| Checkbox | 체크박스 |
|
|
161
|
+
| CodeEditor | SQL/JSON 코드 뷰어 및 간단 편집 (`@exem-ui/react/code-editor`) |
|
|
148
162
|
| Flat | 플랫 리스트 |
|
|
149
|
-
| Icon |
|
|
163
|
+
| Icon | 200+ 아이콘 (`@exem-ui/react/icon`) |
|
|
150
164
|
| Input | 텍스트 입력 |
|
|
151
165
|
| Loading | 로딩 인디케이터 |
|
|
152
166
|
| MessageBox | 메시지 박스 |
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { BeforeMount, OnMount } from '@monaco-editor/react';
|
|
5
|
+
import { editor } from 'monaco-editor';
|
|
6
|
+
import { SqlLanguage } from 'sql-formatter';
|
|
7
|
+
|
|
8
|
+
type CodeEditorViewMode = 'original' | 'formatted';
|
|
9
|
+
type CodeEditorFormatter = (value: string) => string;
|
|
10
|
+
type FormatToggleRenderProps = {
|
|
11
|
+
formatted: boolean;
|
|
12
|
+
toggle: () => void;
|
|
13
|
+
getToggleProps: () => {
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
'aria-pressed': boolean;
|
|
16
|
+
type: 'button';
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type CodeEditorFormatToggleProps = {
|
|
20
|
+
children: (props: FormatToggleRenderProps) => ReactNode;
|
|
21
|
+
};
|
|
22
|
+
type FormatTriggerRenderProps = {
|
|
23
|
+
format: () => void;
|
|
24
|
+
getFormatProps: () => {
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
onClick: () => void;
|
|
27
|
+
type: 'button';
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type CodeEditorFormatTriggerProps = {
|
|
31
|
+
children: (props: FormatTriggerRenderProps) => ReactNode;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type CopyTriggerRenderProps = {
|
|
35
|
+
copied: boolean;
|
|
36
|
+
copy: () => Promise<void>;
|
|
37
|
+
getCopyProps: () => {
|
|
38
|
+
onClick: () => Promise<void>;
|
|
39
|
+
type: 'button';
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
type CodeEditorCopyTriggerProps = {
|
|
43
|
+
children: (props: CopyTriggerRenderProps) => ReactNode;
|
|
44
|
+
copiedDuration?: number;
|
|
45
|
+
formatter?: CodeEditorFormatter | null;
|
|
46
|
+
value?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
declare const CopyTrigger: {
|
|
50
|
+
({ children, copiedDuration, formatter, value, }: CodeEditorCopyTriggerProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
declare const FormatToggle: {
|
|
55
|
+
({ children }: CodeEditorFormatToggleProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
declare const FormatTrigger: {
|
|
60
|
+
({ children }: CodeEditorFormatTriggerProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
displayName: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type CodeEditorOptions = Omit<editor.IStandaloneEditorConstructionOptions, 'theme'>;
|
|
65
|
+
type CodeEditorSurfaceProps = {
|
|
66
|
+
className?: string;
|
|
67
|
+
editorClassName?: string;
|
|
68
|
+
height?: number | string;
|
|
69
|
+
language?: string;
|
|
70
|
+
value?: string;
|
|
71
|
+
formatter?: CodeEditorFormatter | null;
|
|
72
|
+
onChange?: (value?: string) => void;
|
|
73
|
+
options?: CodeEditorOptions;
|
|
74
|
+
readOnly?: boolean;
|
|
75
|
+
beforeMount?: BeforeMount;
|
|
76
|
+
onMount?: OnMount;
|
|
77
|
+
};
|
|
78
|
+
declare const CodeEditorSurface: React.ForwardRefExoticComponent<CodeEditorSurfaceProps & React.RefAttributes<HTMLDivElement>>;
|
|
79
|
+
|
|
80
|
+
type CodeEditorProps = {
|
|
81
|
+
value?: string;
|
|
82
|
+
onValueChange?: (value: string) => void;
|
|
83
|
+
readOnly?: boolean;
|
|
84
|
+
defaultViewMode?: CodeEditorViewMode;
|
|
85
|
+
viewMode?: CodeEditorViewMode;
|
|
86
|
+
onViewModeChange?: (mode: CodeEditorViewMode) => void;
|
|
87
|
+
formatter?: CodeEditorFormatter;
|
|
88
|
+
className?: string;
|
|
89
|
+
children: React.ReactNode;
|
|
90
|
+
};
|
|
91
|
+
type CodeEditorComponent$1 = React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<HTMLDivElement>> & {
|
|
92
|
+
Surface: typeof CodeEditorSurface;
|
|
93
|
+
FormatToggle: typeof FormatToggle;
|
|
94
|
+
FormatTrigger: typeof FormatTrigger;
|
|
95
|
+
CopyTrigger: typeof CopyTrigger;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type CodeEditorJSONProps = Omit<CodeEditorSurfaceProps, 'language'>;
|
|
99
|
+
declare const CodeEditorJSON: React.ForwardRefExoticComponent<CodeEditorJSONProps & React.RefAttributes<HTMLDivElement>>;
|
|
100
|
+
|
|
101
|
+
type SqlEditorDbType = SqlLanguage | 'oracle';
|
|
102
|
+
|
|
103
|
+
type SqlEditorTokenRange = {
|
|
104
|
+
startLineNumber: number;
|
|
105
|
+
startColumn: number;
|
|
106
|
+
endLineNumber: number;
|
|
107
|
+
endColumn: number;
|
|
108
|
+
};
|
|
109
|
+
type SqlEditorToken = {
|
|
110
|
+
id?: string;
|
|
111
|
+
match: string;
|
|
112
|
+
className?: string;
|
|
113
|
+
};
|
|
114
|
+
type ParsedSqlEditorToken = {
|
|
115
|
+
token: SqlEditorToken;
|
|
116
|
+
text: string;
|
|
117
|
+
range: SqlEditorTokenRange;
|
|
118
|
+
startOffset: number;
|
|
119
|
+
endOffset: number;
|
|
120
|
+
className?: string;
|
|
121
|
+
};
|
|
122
|
+
declare const getSqlEditorTokens: (value: string, tokens: SqlEditorToken[]) => ParsedSqlEditorToken[];
|
|
123
|
+
|
|
124
|
+
type CodeEditorSQLProps = Omit<CodeEditorSurfaceProps, 'language'> & {
|
|
125
|
+
dbType?: SqlEditorDbType;
|
|
126
|
+
onTokenClick?: (token: SqlEditorToken) => void;
|
|
127
|
+
tokens?: SqlEditorToken[];
|
|
128
|
+
};
|
|
129
|
+
declare const CodeEditorSQL: React.ForwardRefExoticComponent<Omit<CodeEditorSurfaceProps, "language"> & {
|
|
130
|
+
dbType?: SqlEditorDbType;
|
|
131
|
+
onTokenClick?: (token: SqlEditorToken) => void;
|
|
132
|
+
tokens?: SqlEditorToken[];
|
|
133
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
134
|
+
|
|
135
|
+
type CodeEditorComponent = CodeEditorComponent$1 & {
|
|
136
|
+
JSON: typeof CodeEditorJSON;
|
|
137
|
+
SQL: typeof CodeEditorSQL;
|
|
138
|
+
};
|
|
139
|
+
declare const CodeEditor: CodeEditorComponent;
|
|
140
|
+
|
|
141
|
+
export { CodeEditor, type CodeEditorComponent, type CodeEditorCopyTriggerProps, type CopyTriggerRenderProps as CodeEditorCopyTriggerRenderProps, type CodeEditorFormatToggleProps, type FormatToggleRenderProps as CodeEditorFormatToggleRenderProps, type CodeEditorFormatTriggerProps, type FormatTriggerRenderProps as CodeEditorFormatTriggerRenderProps, type CodeEditorFormatter, type CodeEditorJSONProps, type CodeEditorOptions, type CodeEditorProps, type CodeEditorSQLProps, type CodeEditorSurfaceProps, type CodeEditorViewMode, type ParsedSqlEditorToken, type SqlEditorDbType, type SqlEditorToken, type SqlEditorTokenRange, getSqlEditorTokens };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { BeforeMount, OnMount } from '@monaco-editor/react';
|
|
5
|
+
import { editor } from 'monaco-editor';
|
|
6
|
+
import { SqlLanguage } from 'sql-formatter';
|
|
7
|
+
|
|
8
|
+
type CodeEditorViewMode = 'original' | 'formatted';
|
|
9
|
+
type CodeEditorFormatter = (value: string) => string;
|
|
10
|
+
type FormatToggleRenderProps = {
|
|
11
|
+
formatted: boolean;
|
|
12
|
+
toggle: () => void;
|
|
13
|
+
getToggleProps: () => {
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
'aria-pressed': boolean;
|
|
16
|
+
type: 'button';
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type CodeEditorFormatToggleProps = {
|
|
20
|
+
children: (props: FormatToggleRenderProps) => ReactNode;
|
|
21
|
+
};
|
|
22
|
+
type FormatTriggerRenderProps = {
|
|
23
|
+
format: () => void;
|
|
24
|
+
getFormatProps: () => {
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
onClick: () => void;
|
|
27
|
+
type: 'button';
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type CodeEditorFormatTriggerProps = {
|
|
31
|
+
children: (props: FormatTriggerRenderProps) => ReactNode;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type CopyTriggerRenderProps = {
|
|
35
|
+
copied: boolean;
|
|
36
|
+
copy: () => Promise<void>;
|
|
37
|
+
getCopyProps: () => {
|
|
38
|
+
onClick: () => Promise<void>;
|
|
39
|
+
type: 'button';
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
type CodeEditorCopyTriggerProps = {
|
|
43
|
+
children: (props: CopyTriggerRenderProps) => ReactNode;
|
|
44
|
+
copiedDuration?: number;
|
|
45
|
+
formatter?: CodeEditorFormatter | null;
|
|
46
|
+
value?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
declare const CopyTrigger: {
|
|
50
|
+
({ children, copiedDuration, formatter, value, }: CodeEditorCopyTriggerProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
declare const FormatToggle: {
|
|
55
|
+
({ children }: CodeEditorFormatToggleProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
declare const FormatTrigger: {
|
|
60
|
+
({ children }: CodeEditorFormatTriggerProps): react_jsx_runtime.JSX.Element;
|
|
61
|
+
displayName: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type CodeEditorOptions = Omit<editor.IStandaloneEditorConstructionOptions, 'theme'>;
|
|
65
|
+
type CodeEditorSurfaceProps = {
|
|
66
|
+
className?: string;
|
|
67
|
+
editorClassName?: string;
|
|
68
|
+
height?: number | string;
|
|
69
|
+
language?: string;
|
|
70
|
+
value?: string;
|
|
71
|
+
formatter?: CodeEditorFormatter | null;
|
|
72
|
+
onChange?: (value?: string) => void;
|
|
73
|
+
options?: CodeEditorOptions;
|
|
74
|
+
readOnly?: boolean;
|
|
75
|
+
beforeMount?: BeforeMount;
|
|
76
|
+
onMount?: OnMount;
|
|
77
|
+
};
|
|
78
|
+
declare const CodeEditorSurface: React.ForwardRefExoticComponent<CodeEditorSurfaceProps & React.RefAttributes<HTMLDivElement>>;
|
|
79
|
+
|
|
80
|
+
type CodeEditorProps = {
|
|
81
|
+
value?: string;
|
|
82
|
+
onValueChange?: (value: string) => void;
|
|
83
|
+
readOnly?: boolean;
|
|
84
|
+
defaultViewMode?: CodeEditorViewMode;
|
|
85
|
+
viewMode?: CodeEditorViewMode;
|
|
86
|
+
onViewModeChange?: (mode: CodeEditorViewMode) => void;
|
|
87
|
+
formatter?: CodeEditorFormatter;
|
|
88
|
+
className?: string;
|
|
89
|
+
children: React.ReactNode;
|
|
90
|
+
};
|
|
91
|
+
type CodeEditorComponent$1 = React.ForwardRefExoticComponent<CodeEditorProps & React.RefAttributes<HTMLDivElement>> & {
|
|
92
|
+
Surface: typeof CodeEditorSurface;
|
|
93
|
+
FormatToggle: typeof FormatToggle;
|
|
94
|
+
FormatTrigger: typeof FormatTrigger;
|
|
95
|
+
CopyTrigger: typeof CopyTrigger;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type CodeEditorJSONProps = Omit<CodeEditorSurfaceProps, 'language'>;
|
|
99
|
+
declare const CodeEditorJSON: React.ForwardRefExoticComponent<CodeEditorJSONProps & React.RefAttributes<HTMLDivElement>>;
|
|
100
|
+
|
|
101
|
+
type SqlEditorDbType = SqlLanguage | 'oracle';
|
|
102
|
+
|
|
103
|
+
type SqlEditorTokenRange = {
|
|
104
|
+
startLineNumber: number;
|
|
105
|
+
startColumn: number;
|
|
106
|
+
endLineNumber: number;
|
|
107
|
+
endColumn: number;
|
|
108
|
+
};
|
|
109
|
+
type SqlEditorToken = {
|
|
110
|
+
id?: string;
|
|
111
|
+
match: string;
|
|
112
|
+
className?: string;
|
|
113
|
+
};
|
|
114
|
+
type ParsedSqlEditorToken = {
|
|
115
|
+
token: SqlEditorToken;
|
|
116
|
+
text: string;
|
|
117
|
+
range: SqlEditorTokenRange;
|
|
118
|
+
startOffset: number;
|
|
119
|
+
endOffset: number;
|
|
120
|
+
className?: string;
|
|
121
|
+
};
|
|
122
|
+
declare const getSqlEditorTokens: (value: string, tokens: SqlEditorToken[]) => ParsedSqlEditorToken[];
|
|
123
|
+
|
|
124
|
+
type CodeEditorSQLProps = Omit<CodeEditorSurfaceProps, 'language'> & {
|
|
125
|
+
dbType?: SqlEditorDbType;
|
|
126
|
+
onTokenClick?: (token: SqlEditorToken) => void;
|
|
127
|
+
tokens?: SqlEditorToken[];
|
|
128
|
+
};
|
|
129
|
+
declare const CodeEditorSQL: React.ForwardRefExoticComponent<Omit<CodeEditorSurfaceProps, "language"> & {
|
|
130
|
+
dbType?: SqlEditorDbType;
|
|
131
|
+
onTokenClick?: (token: SqlEditorToken) => void;
|
|
132
|
+
tokens?: SqlEditorToken[];
|
|
133
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
134
|
+
|
|
135
|
+
type CodeEditorComponent = CodeEditorComponent$1 & {
|
|
136
|
+
JSON: typeof CodeEditorJSON;
|
|
137
|
+
SQL: typeof CodeEditorSQL;
|
|
138
|
+
};
|
|
139
|
+
declare const CodeEditor: CodeEditorComponent;
|
|
140
|
+
|
|
141
|
+
export { CodeEditor, type CodeEditorComponent, type CodeEditorCopyTriggerProps, type CopyTriggerRenderProps as CodeEditorCopyTriggerRenderProps, type CodeEditorFormatToggleProps, type FormatToggleRenderProps as CodeEditorFormatToggleRenderProps, type CodeEditorFormatTriggerProps, type FormatTriggerRenderProps as CodeEditorFormatTriggerRenderProps, type CodeEditorFormatter, type CodeEditorJSONProps, type CodeEditorOptions, type CodeEditorProps, type CodeEditorSQLProps, type CodeEditorSurfaceProps, type CodeEditorViewMode, type ParsedSqlEditorToken, type SqlEditorDbType, type SqlEditorToken, type SqlEditorTokenRange, getSqlEditorTokens };
|