@reopt-ai/opt-ui 1.4.1

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 (64) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/COMPONENT_CATALOG.md +3000 -0
  3. package/LICENSE +21 -0
  4. package/README.md +244 -0
  5. package/dist/chunk-3GWWZKX7.js +38 -0
  6. package/dist/chunk-AFF2HPE5.cjs +5008 -0
  7. package/dist/chunk-ELWICXYY.js +4745 -0
  8. package/dist/chunk-N4NDU5ET.cjs +4745 -0
  9. package/dist/chunk-ONE3C5RV.cjs +38 -0
  10. package/dist/chunk-QWBHD54V.js +3218 -0
  11. package/dist/chunk-RBM2RNC2.js +5008 -0
  12. package/dist/chunk-X5WCXJAF.cjs +3218 -0
  13. package/dist/core/index.cjs +324 -0
  14. package/dist/core/index.d.cts +5 -0
  15. package/dist/core/index.d.ts +5 -0
  16. package/dist/core/index.js +324 -0
  17. package/dist/docs/01-getting-started.md +129 -0
  18. package/dist/docs/02-components/01-core.md +1841 -0
  19. package/dist/docs/02-components/02-visuals.md +11 -0
  20. package/dist/docs/02-components/03-shells.md +1361 -0
  21. package/dist/docs/02-components/04-surfaces.md +11 -0
  22. package/dist/docs/02-components/index.md +106 -0
  23. package/dist/docs/03-recipes/01-forms.md +471 -0
  24. package/dist/docs/03-recipes/02-dashboards.md +397 -0
  25. package/dist/docs/03-recipes/03-layouts.md +424 -0
  26. package/dist/docs/04-theming.md +232 -0
  27. package/dist/docs/05-migration/01-breaking-changes.md +117 -0
  28. package/dist/docs/05-migration/02-formstore.md +336 -0
  29. package/dist/docs/06-troubleshooting.md +119 -0
  30. package/dist/docs/index.md +71 -0
  31. package/dist/id-registry.cjs +1875 -0
  32. package/dist/id-registry.d.cts +27 -0
  33. package/dist/id-registry.d.ts +27 -0
  34. package/dist/id-registry.js +1875 -0
  35. package/dist/id-registry.json +3799 -0
  36. package/dist/index-BZ_lBlO1.d.ts +474 -0
  37. package/dist/index-BuvxoWHf.d.cts +474 -0
  38. package/dist/index-DlAcuvQp.d.cts +1686 -0
  39. package/dist/index-Slu5hOj1.d.ts +1686 -0
  40. package/dist/index.cjs +9959 -0
  41. package/dist/index.d.cts +2351 -0
  42. package/dist/index.d.ts +2351 -0
  43. package/dist/index.js +9959 -0
  44. package/dist/meta.cjs +6898 -0
  45. package/dist/meta.d.cts +36 -0
  46. package/dist/meta.d.ts +36 -0
  47. package/dist/meta.js +6869 -0
  48. package/dist/shells/index.cjs +65 -0
  49. package/dist/shells/index.d.cts +5 -0
  50. package/dist/shells/index.d.ts +5 -0
  51. package/dist/shells/index.js +65 -0
  52. package/dist/tailwind.css +401 -0
  53. package/dist/theme/presets/default.css +355 -0
  54. package/dist/theme/presets/minimal.css +354 -0
  55. package/dist/theme/presets/mono-dark.css +354 -0
  56. package/dist/theme/presets/natural.css +181 -0
  57. package/dist/theme/presets/pro.css +354 -0
  58. package/dist/types-D4-0lwaE.d.cts +298 -0
  59. package/dist/types-D4-0lwaE.d.ts +298 -0
  60. package/dist/visuals/index.cjs +4 -0
  61. package/dist/visuals/index.d.cts +1 -0
  62. package/dist/visuals/index.d.ts +1 -0
  63. package/dist/visuals/index.js +4 -0
  64. package/package.json +165 -0
@@ -0,0 +1,298 @@
1
+ /** Defines the command shape (data for command palettes / menus). */
2
+ interface CommandDef {
3
+ id: string;
4
+ label: string;
5
+ group: string;
6
+ shortcut?: string;
7
+ action: () => void;
8
+ }
9
+ /** Defines the stat card shape. */
10
+ interface StatCard {
11
+ id: string;
12
+ title: string;
13
+ value: string;
14
+ change: string;
15
+ trend: "up" | "down" | "neutral";
16
+ rawValue?: number;
17
+ format?: "text" | "duration" | "percentage";
18
+ durationUnit?: "ms" | "s";
19
+ }
20
+ /** Defines the nav item shape. */
21
+ interface NavItem {
22
+ id: string;
23
+ label: string;
24
+ href: string;
25
+ }
26
+ /** Defines the faq item shape. */
27
+ interface FaqItem {
28
+ id: string;
29
+ question: string;
30
+ answer: string;
31
+ }
32
+ /** Defines the select option shape. */
33
+ interface SelectOption {
34
+ value: string;
35
+ label: string;
36
+ color?: string;
37
+ }
38
+ /** Defines the menu item shape. */
39
+ interface MenuItemDef {
40
+ id: string;
41
+ label: string;
42
+ type?: "item" | "separator" | "checkbox" | "radio";
43
+ shortcut?: string;
44
+ name?: string;
45
+ value?: string;
46
+ checked?: boolean;
47
+ onChange?: (checked: boolean) => void;
48
+ onClick?: () => void;
49
+ }
50
+ /** Defines the menu shape. */
51
+ interface MenuDef {
52
+ id: string;
53
+ label: string;
54
+ items: MenuItemDef[];
55
+ }
56
+ /** Defines the nav item shape. */
57
+ interface NavItemDef {
58
+ id: string;
59
+ label: string;
60
+ href: string;
61
+ separator?: boolean;
62
+ sectionLabel?: string;
63
+ }
64
+ /** Defines the toolbar button shape. */
65
+ interface ToolbarButtonDef {
66
+ id: string;
67
+ label: string;
68
+ icon: React.ReactNode;
69
+ separator?: boolean;
70
+ }
71
+ /** Defines the tab shape. */
72
+ interface TabDef {
73
+ id: string;
74
+ label: string;
75
+ content: React.ReactNode;
76
+ }
77
+ /** Defines the form field shape. */
78
+ interface FormFieldDef {
79
+ name: string;
80
+ label: string;
81
+ type?: "text" | "email" | "password" | "number" | "checkbox" | "radio" | "textarea" | "select" | "switch" | "tags";
82
+ placeholder?: string;
83
+ defaultValue?: unknown;
84
+ required?: boolean;
85
+ requiredMessage?: string;
86
+ validate?: (value: unknown) => string | undefined;
87
+ options?: {
88
+ value: string;
89
+ label: string;
90
+ }[];
91
+ /** textarea 전용: 표시 줄 수 */
92
+ rows?: number;
93
+ /** textarea 전용: 크기 조절 방향 */
94
+ resize?: "none" | "vertical" | "horizontal" | "both";
95
+ /** textarea 전용: 폰트 스타일 */
96
+ font?: "default" | "mono";
97
+ /** switch 전용: 설명 텍스트 */
98
+ description?: string;
99
+ /** 조건부 필드 표시 — false 또는 함수가 false를 반환하면 필드 숨김 */
100
+ visible?: boolean | ((values: Record<string, unknown>) => boolean);
101
+ }
102
+ /** Defines the deployment step shape. */
103
+ interface DeploymentStep {
104
+ id: string;
105
+ name: string;
106
+ status: "pending" | "running" | "success" | "error" | "skipped";
107
+ duration?: string;
108
+ detail?: string;
109
+ }
110
+ /** Defines the project shape. */
111
+ interface ProjectDef {
112
+ id: string;
113
+ name: string;
114
+ framework: string;
115
+ status: "active" | "paused" | "error";
116
+ domain?: string;
117
+ }
118
+ /** Defines the env var shape. */
119
+ interface EnvVarDef {
120
+ key: string;
121
+ value: string;
122
+ isSecret?: boolean;
123
+ }
124
+ /** Defines the env group shape. */
125
+ interface EnvGroupDef {
126
+ env: string;
127
+ vars: EnvVarDef[];
128
+ }
129
+ /** Defines the branch shape. */
130
+ interface BranchDef {
131
+ name: string;
132
+ isDefault?: boolean;
133
+ lastCommit?: string;
134
+ author?: string;
135
+ }
136
+ /** Defines the domain shape. */
137
+ interface DomainDef {
138
+ domain: string;
139
+ status: "active" | "pending" | "error";
140
+ ssl: "valid" | "expired" | "pending";
141
+ redirect?: string;
142
+ addedAt?: string;
143
+ }
144
+ /** Defines the table column shape. */
145
+ interface TableColumn<T> {
146
+ id: string;
147
+ header: string;
148
+ accessor: keyof T | ((row: T) => React.ReactNode);
149
+ width?: string;
150
+ align?: "left" | "center" | "right";
151
+ }
152
+ /** Defines the toast options shape. */
153
+ interface ToastOptions {
154
+ variant: "info" | "success" | "warning" | "error";
155
+ title?: string;
156
+ message: string;
157
+ duration?: number;
158
+ }
159
+ /** Defines the task shape. */
160
+ interface TaskDef {
161
+ id: string;
162
+ title: string;
163
+ description?: string;
164
+ status: "todo" | "in-progress" | "review" | "done";
165
+ priority: "low" | "medium" | "high" | "urgent";
166
+ assignee?: TeamMemberDef;
167
+ dueDate?: string;
168
+ tags?: string[];
169
+ subtasks?: {
170
+ id: string;
171
+ title: string;
172
+ completed: boolean;
173
+ }[];
174
+ }
175
+ /** Defines the team member shape. */
176
+ interface TeamMemberDef {
177
+ id: string;
178
+ name: string;
179
+ email: string;
180
+ avatar?: string;
181
+ role?: string;
182
+ status?: "online" | "away" | "busy" | "offline";
183
+ }
184
+ /** Defines the activity shape. */
185
+ interface ActivityDef {
186
+ id: string;
187
+ type: "created" | "updated" | "completed" | "commented" | "assigned" | "deployed" | "merged";
188
+ title: string;
189
+ description?: string;
190
+ actor: TeamMemberDef;
191
+ timestamp: string;
192
+ metadata?: Record<string, unknown>;
193
+ variant?: "default" | "error" | "warning";
194
+ }
195
+ /** Defines the filter option shape. */
196
+ interface FilterOption {
197
+ id: string;
198
+ label: string;
199
+ value: string;
200
+ }
201
+ /** Defines the filter group shape. */
202
+ interface FilterGroupDef {
203
+ id: string;
204
+ label: string;
205
+ type: "select" | "multi-select" | "search" | "date-range" | "tag" | "toggle";
206
+ options?: FilterOption[];
207
+ value?: string | string[] | boolean;
208
+ }
209
+ /** Defines the quick action shape. */
210
+ interface QuickActionDef {
211
+ id: string;
212
+ label: string;
213
+ description?: string;
214
+ icon?: React.ReactNode;
215
+ shortcut?: string;
216
+ onClick: () => void;
217
+ disabled?: boolean;
218
+ }
219
+ /** Defines the time preset shape. */
220
+ interface TimePreset {
221
+ label: string;
222
+ days: number;
223
+ }
224
+ /** Type definition for export format. */
225
+ type ExportFormat = "csv" | "json" | "pdf";
226
+ /** Defines the export column shape. */
227
+ interface ExportColumn {
228
+ key: string;
229
+ header: string;
230
+ }
231
+ /** Defines the failure item shape. */
232
+ interface FailureItem {
233
+ id: string;
234
+ title: string;
235
+ message?: string;
236
+ severity: "critical" | "error" | "warning";
237
+ timestamp: string;
238
+ group?: string;
239
+ metadata?: Record<string, unknown>;
240
+ }
241
+ /** Defines the chart data point shape. */
242
+ interface ChartDataPoint {
243
+ name: string;
244
+ [key: string]: string | number;
245
+ }
246
+ /** Defines the chart series shape. */
247
+ interface ChartSeriesDef {
248
+ dataKey: string;
249
+ name: string;
250
+ color?: string;
251
+ type?: "line" | "bar" | "area";
252
+ stackId?: string;
253
+ }
254
+ /** Configuration for chart. */
255
+ interface ChartConfig {
256
+ series: ChartSeriesDef[];
257
+ xAxisKey?: string;
258
+ showGrid?: boolean;
259
+ showTooltip?: boolean;
260
+ showLegend?: boolean;
261
+ animate?: boolean;
262
+ }
263
+ /** Defines the chart margin shape. */
264
+ interface ChartMargin {
265
+ top?: number;
266
+ right?: number;
267
+ bottom?: number;
268
+ left?: number;
269
+ }
270
+ /** Defines the chat conversation shape. */
271
+ interface ChatConversationDef {
272
+ id: string;
273
+ title: string;
274
+ lastMessage?: string;
275
+ timestamp: string;
276
+ unread?: boolean;
277
+ }
278
+ /** Defines the chat message shape. */
279
+ interface ChatMessageDef {
280
+ id: string;
281
+ role: "user" | "assistant";
282
+ content: string;
283
+ timestamp: string;
284
+ }
285
+ /** Defines the chat model shape. */
286
+ interface ChatModelDef {
287
+ id: string;
288
+ label: string;
289
+ description?: string;
290
+ }
291
+ /** Defines the chat style preset shape. */
292
+ interface ChatStylePresetDef {
293
+ id: string;
294
+ label: string;
295
+ systemPrompt?: string;
296
+ }
297
+
298
+ export type { ActivityDef as A, BranchDef as B, ChatConversationDef as C, DeploymentStep as D, ExportColumn as E, FilterGroupDef as F, MenuDef as M, NavItem as N, ProjectDef as P, QuickActionDef as Q, StatCard as S, TaskDef as T, TeamMemberDef as a, FormFieldDef as b, ExportFormat as c, TabDef as d, ChatModelDef as e, ChatStylePresetDef as f, ChatMessageDef as g, ChartConfig as h, ChartDataPoint as i, ChartMargin as j, ChartSeriesDef as k, CommandDef as l, DomainDef as m, EnvGroupDef as n, EnvVarDef as o, FailureItem as p, FaqItem as q, FilterOption as r, MenuItemDef as s, NavItemDef as t, SelectOption as u, TableColumn as v, TimePreset as w, ToastOptions as x, ToolbarButtonDef as y };
@@ -0,0 +1,4 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }"use client";
2
+
3
+ // src/visuals/index.ts
4
+ var _optcharts = require('@reopt-ai/opt-charts'); _createStarExport(_optcharts);
@@ -0,0 +1 @@
1
+ export * from '@reopt-ai/opt-charts';
@@ -0,0 +1 @@
1
+ export * from '@reopt-ai/opt-charts';
@@ -0,0 +1,4 @@
1
+ "use client";
2
+
3
+ // src/visuals/index.ts
4
+ export * from "@reopt-ai/opt-charts";
package/package.json ADDED
@@ -0,0 +1,165 @@
1
+ {
2
+ "name": "@reopt-ai/opt-ui",
3
+ "version": "1.4.1",
4
+ "description": "접근성 우선 UI 컴포넌트 라이브러리. opt-ui-primitives Core, 비즈니스 Shells, 페이지 Surfaces.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=20.0.0"
9
+ },
10
+ "author": {
11
+ "name": "reopt-ai",
12
+ "url": "https://github.com/reopt-ai"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/reopt-ai/react-design.git",
17
+ "directory": "packages/opt-ui"
18
+ },
19
+ "homepage": "https://design.reopt.ai/docs/opt-ui",
20
+ "keywords": [
21
+ "react",
22
+ "ui",
23
+ "components",
24
+ "accessibility",
25
+ "a11y",
26
+ "opt-ui-primitives",
27
+ "keyboard-navigation",
28
+ "spatial-navigation",
29
+ "tailwindcss",
30
+ "design-system"
31
+ ],
32
+ "sideEffects": [
33
+ "./dist/lib/theme/presets/*.css",
34
+ "./dist/theme/presets/*.css",
35
+ "./dist/tailwind.css",
36
+ "./dist/tailwind.css"
37
+ ],
38
+ "main": "./dist/index.cjs",
39
+ "module": "./dist/index.js",
40
+ "types": "./dist/index.d.ts",
41
+ "exports": {
42
+ ".": {
43
+ "import": {
44
+ "types": "./dist/index.d.ts",
45
+ "default": "./dist/index.js"
46
+ },
47
+ "require": {
48
+ "types": "./dist/index.d.cts",
49
+ "default": "./dist/index.cjs"
50
+ },
51
+ "default": "./dist/index.js"
52
+ },
53
+ "./core": {
54
+ "import": {
55
+ "types": "./dist/core/index.d.ts",
56
+ "default": "./dist/core/index.js"
57
+ },
58
+ "require": {
59
+ "types": "./dist/core/index.d.cts",
60
+ "default": "./dist/core/index.cjs"
61
+ },
62
+ "default": "./dist/core/index.js"
63
+ },
64
+ "./visuals": {
65
+ "import": {
66
+ "types": "./dist/visuals/index.d.ts",
67
+ "default": "./dist/visuals/index.js"
68
+ },
69
+ "require": {
70
+ "types": "./dist/visuals/index.d.cts",
71
+ "default": "./dist/visuals/index.cjs"
72
+ },
73
+ "default": "./dist/visuals/index.js"
74
+ },
75
+ "./shells": {
76
+ "import": {
77
+ "types": "./dist/shells/index.d.ts",
78
+ "default": "./dist/shells/index.js"
79
+ },
80
+ "require": {
81
+ "types": "./dist/shells/index.d.cts",
82
+ "default": "./dist/shells/index.cjs"
83
+ },
84
+ "default": "./dist/shells/index.js"
85
+ },
86
+ "./meta": {
87
+ "import": {
88
+ "types": "./dist/meta.d.ts",
89
+ "default": "./dist/meta.js"
90
+ },
91
+ "require": {
92
+ "types": "./dist/meta.d.cts",
93
+ "default": "./dist/meta.cjs"
94
+ },
95
+ "default": "./dist/meta.js"
96
+ },
97
+ "./id-registry": {
98
+ "import": {
99
+ "types": "./dist/id-registry.d.ts",
100
+ "default": "./dist/id-registry.js"
101
+ },
102
+ "require": {
103
+ "types": "./dist/id-registry.d.cts",
104
+ "default": "./dist/id-registry.cjs"
105
+ },
106
+ "default": "./dist/id-registry.js"
107
+ },
108
+ "./id-registry.json": "./dist/id-registry.json",
109
+ "./tailwind.css": "./dist/tailwind.css",
110
+ "./theme/presets/default.css": "./dist/theme/presets/default.css",
111
+ "./theme/presets/minimal.css": "./dist/theme/presets/minimal.css",
112
+ "./theme/presets/natural.css": "./dist/theme/presets/natural.css",
113
+ "./theme/presets/pro.css": "./dist/theme/presets/pro.css",
114
+ "./theme/presets/mono-dark.css": "./dist/theme/presets/mono-dark.css"
115
+ },
116
+ "files": [
117
+ "dist",
118
+ "README.md",
119
+ "COMPONENT_CATALOG.md",
120
+ "LICENSE",
121
+ "CHANGELOG.md"
122
+ ],
123
+ "publishConfig": {
124
+ "access": "public",
125
+ "registry": "https://registry.npmjs.org"
126
+ },
127
+ "dependencies": {
128
+ "@reopt-ai/opt-charts": "^1.0.0",
129
+ "@reopt-ai/opt-palette": "^1.0.0",
130
+ "@reopt-ai/opt-ui-primitives": "^1.4.2",
131
+ "clsx": "^2.1.1",
132
+ "lucide-react": "^0.577.0",
133
+ "match-sorter": "^8.2.0",
134
+ "ogl": "^1.0.11",
135
+ "react-is": "^19.2.7",
136
+ "react-resizable-panels": "^4.6.2",
137
+ "tailwind-merge": "^3.4.0"
138
+ },
139
+ "peerDependencies": {
140
+ "react": "^19.0.0",
141
+ "react-dom": "^19.0.0",
142
+ "next": ">=16.0.0",
143
+ "@codemirror/lang-sql": "^6.10.0",
144
+ "@codemirror/state": "^6.5.4",
145
+ "@codemirror/theme-one-dark": "^6.1.3",
146
+ "@codemirror/view": "^6.39.12"
147
+ },
148
+ "peerDependenciesMeta": {
149
+ "next": {
150
+ "optional": true
151
+ },
152
+ "@codemirror/lang-sql": {
153
+ "optional": true
154
+ },
155
+ "@codemirror/state": {
156
+ "optional": true
157
+ },
158
+ "@codemirror/theme-one-dark": {
159
+ "optional": true
160
+ },
161
+ "@codemirror/view": {
162
+ "optional": true
163
+ }
164
+ }
165
+ }