@reopt-ai/opt-ui 1.9.0 → 1.11.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/COMPONENT_CATALOG.md +177 -66
- package/README.md +21 -5
- package/dist/core/index.cjs +106 -104
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +3 -3
- package/dist/docs/02-components/01-core.md +92 -41
- package/dist/docs/02-components/02-visuals.md +1 -1
- package/dist/docs/02-components/03-shells.md +96 -26
- package/dist/docs/02-components/04-surfaces.md +1 -1
- package/dist/docs/02-components/index.md +5 -5
- package/dist/{field-sidebar-B5vk3luQ.d.cts → field-sidebar-B5SQC35J.d.cts} +226 -3
- package/dist/field-sidebar-B5SQC35J.d.cts.map +1 -0
- package/dist/{field-sidebar-B7QkWvMG.js → field-sidebar-BXl5RJ3q.js} +599 -43
- package/dist/field-sidebar-BXl5RJ3q.js.map +1 -0
- package/dist/{field-sidebar-Dk9gJGA_.d.ts → field-sidebar-CBeWE8xX.d.ts} +226 -3
- package/dist/field-sidebar-CBeWE8xX.d.ts.map +1 -0
- package/dist/{field-sidebar-mFHemxBz.cjs → field-sidebar-DAuN4jPV.cjs} +883 -309
- package/dist/id-registry.cjs +46 -6
- package/dist/id-registry.d.cts.map +1 -1
- package/dist/id-registry.d.ts.map +1 -1
- package/dist/id-registry.js +46 -6
- package/dist/id-registry.js.map +1 -1
- package/dist/id-registry.json +97 -12
- package/dist/index.cjs +593 -587
- package/dist/index.d.cts +10 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -19
- package/dist/index.js.map +1 -1
- package/dist/{key-pad-menu-D8OS_VCT.d.cts → key-pad-menu-BxTy_u0Q.d.cts} +152 -51
- package/dist/key-pad-menu-BxTy_u0Q.d.cts.map +1 -0
- package/dist/{key-pad-menu-DoGskWbp.cjs → key-pad-menu-Cg6rZBie.cjs} +670 -923
- package/dist/{key-pad-menu-EEb6Ho5h.d.ts → key-pad-menu-u5GTJl9B.d.ts} +152 -51
- package/dist/key-pad-menu-u5GTJl9B.d.ts.map +1 -0
- package/dist/{key-pad-menu-BFd79JoS.js → key-pad-menu-wXkWn1I1.js} +500 -699
- package/dist/key-pad-menu-wXkWn1I1.js.map +1 -0
- package/dist/meta.cjs +486 -9
- package/dist/meta.d.cts.map +1 -1
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +486 -9
- package/dist/meta.js.map +1 -1
- package/dist/shells/index.cjs +4 -1
- package/dist/shells/index.d.cts +2 -2
- package/dist/shells/index.d.ts +2 -2
- package/dist/shells/index.js +2 -2
- package/dist/{highlight-CGcrYGMC.cjs → text-truncate-BZdL1k5Z.cjs} +608 -83
- package/dist/{highlight-C2sfnJN8.js → text-truncate-C17HHCR-.js} +534 -87
- package/dist/text-truncate-C17HHCR-.js.map +1 -0
- package/dist/{field-token-CSOrU5gl.d.ts → text-truncate-DW78lg4S.d.cts} +63 -4
- package/dist/text-truncate-DW78lg4S.d.cts.map +1 -0
- package/dist/{field-token-CSOrU5gl.d.cts → text-truncate-DW78lg4S.d.ts} +63 -4
- package/dist/text-truncate-DW78lg4S.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/field-sidebar-B5vk3luQ.d.cts.map +0 -1
- package/dist/field-sidebar-B7QkWvMG.js.map +0 -1
- package/dist/field-sidebar-Dk9gJGA_.d.ts.map +0 -1
- package/dist/field-token-CSOrU5gl.d.cts.map +0 -1
- package/dist/field-token-CSOrU5gl.d.ts.map +0 -1
- package/dist/highlight-C2sfnJN8.js.map +0 -1
- package/dist/key-pad-menu-BFd79JoS.js.map +0 -1
- package/dist/key-pad-menu-D8OS_VCT.d.cts.map +0 -1
- package/dist/key-pad-menu-EEb6Ho5h.d.ts.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
2
|
+
const require_text_truncate = require("./text-truncate-BZdL1k5Z.cjs");
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
let react = require("react");
|
|
5
|
-
react =
|
|
5
|
+
react = require_text_truncate.__toESM(react, 1);
|
|
6
6
|
let _reopt_ai_opt_ui_primitives = require("@reopt-ai/opt-ui-primitives");
|
|
7
7
|
let lucide_react = require("lucide-react");
|
|
8
8
|
let _reopt_ai_opt_charts = require("@reopt-ai/opt-charts");
|
|
9
9
|
let match_sorter = require("match-sorter");
|
|
10
10
|
let next_link = require("next/link");
|
|
11
|
-
next_link =
|
|
11
|
+
next_link = require_text_truncate.__toESM(next_link, 1);
|
|
12
12
|
let next_navigation = require("next/navigation");
|
|
13
13
|
//#region src/core/command.tsx
|
|
14
14
|
const _excluded = ["className"];
|
|
@@ -27,27 +27,27 @@ const _excluded7 = ["className"];
|
|
|
27
27
|
const _excluded8 = ["className"];
|
|
28
28
|
/** Renders the `Command` component. */
|
|
29
29
|
function Command(_ref) {
|
|
30
|
-
let { className } = _ref, props =
|
|
31
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandRoot,
|
|
30
|
+
let { className } = _ref, props = require_text_truncate._objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandRoot, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({ className: require_text_truncate.cn("bg-surface text-text-primary flex w-full flex-col overflow-hidden rounded-xl", className) }, props), {}, {
|
|
32
32
|
"data-opt-id": "4FYBW",
|
|
33
33
|
"data-opt-slug": "command.Command"
|
|
34
34
|
}));
|
|
35
35
|
}
|
|
36
36
|
/** Renders a Command in a dialog overlay, à la Cmd+K palette. */
|
|
37
37
|
function CommandDialog({ open, onOpenChange, title = "Command Palette", description = "검색 후 Enter 또는 클릭으로 명령을 실행하세요.", className, commandClassName, shouldFilter, filter, children }) {
|
|
38
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DialogRoot, {
|
|
39
39
|
open,
|
|
40
40
|
onOpenChange,
|
|
41
41
|
"data-opt-id": "DVRSX",
|
|
42
42
|
"data-opt-slug": "command.CommandDialog",
|
|
43
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
44
|
-
className:
|
|
43
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.DialogPanel, {
|
|
44
|
+
className: require_text_truncate.cn("top-[20%] left-1/2 -translate-x-1/2", "w-full max-w-lg overflow-hidden p-0 shadow-2xl", className),
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
46
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DialogHeading, {
|
|
47
47
|
className: "sr-only",
|
|
48
48
|
children: title
|
|
49
49
|
}),
|
|
50
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
50
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DialogDescription, {
|
|
51
51
|
className: "sr-only",
|
|
52
52
|
children: description
|
|
53
53
|
}),
|
|
@@ -63,10 +63,10 @@ function CommandDialog({ open, onOpenChange, title = "Command Palette", descript
|
|
|
63
63
|
}
|
|
64
64
|
/** Renders the `CommandInput` component with a leading search icon. */
|
|
65
65
|
function CommandInput(_ref2) {
|
|
66
|
-
let { className, trailing, wrapperClassName, placeholder, "aria-label": ariaLabel } = _ref2, props =
|
|
66
|
+
let { className, trailing, wrapperClassName, placeholder, "aria-label": ariaLabel } = _ref2, props = require_text_truncate._objectWithoutProperties(_ref2, _excluded2);
|
|
67
67
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
68
68
|
"data-slot": "command-input-wrapper",
|
|
69
|
-
className:
|
|
69
|
+
className: require_text_truncate.cn("border-border-subtle gap-element flex h-12 items-center border-b px-3", wrapperClassName),
|
|
70
70
|
"data-opt-id": "HB1K3",
|
|
71
71
|
"data-opt-slug": "command.CommandInput",
|
|
72
72
|
children: [
|
|
@@ -74,8 +74,8 @@ function CommandInput(_ref2) {
|
|
|
74
74
|
"aria-hidden": true,
|
|
75
75
|
className: "text-text-tertiary size-4 shrink-0"
|
|
76
76
|
}),
|
|
77
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandInput,
|
|
78
|
-
className:
|
|
77
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandInput, require_text_truncate._objectSpread2({
|
|
78
|
+
className: require_text_truncate.cn("text-text-primary placeholder:text-text-tertiary flex h-full w-full bg-transparent text-sm outline-none focus-visible:ring-0 focus-visible:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
79
79
|
placeholder,
|
|
80
80
|
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : typeof placeholder === "string" ? placeholder : "Command search"
|
|
81
81
|
}, props)),
|
|
@@ -85,9 +85,9 @@ function CommandInput(_ref2) {
|
|
|
85
85
|
}
|
|
86
86
|
/** Renders the `CommandList` component. */
|
|
87
87
|
function CommandList(_ref3) {
|
|
88
|
-
let { className, "aria-label": ariaLabel } = _ref3, props =
|
|
89
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandList,
|
|
90
|
-
className:
|
|
88
|
+
let { className, "aria-label": ariaLabel } = _ref3, props = require_text_truncate._objectWithoutProperties(_ref3, _excluded3);
|
|
89
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandList, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({
|
|
90
|
+
className: require_text_truncate.cn("max-h-80 scroll-py-1 overflow-x-hidden overflow-y-auto p-1", className),
|
|
91
91
|
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "Commands"
|
|
92
92
|
}, props), {}, {
|
|
93
93
|
"data-opt-id": "NPXC5",
|
|
@@ -96,21 +96,21 @@ function CommandList(_ref3) {
|
|
|
96
96
|
}
|
|
97
97
|
/** Renders the `CommandEmpty` component. */
|
|
98
98
|
function CommandEmpty(_ref4) {
|
|
99
|
-
let { className } = _ref4, props =
|
|
100
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandEmpty,
|
|
99
|
+
let { className } = _ref4, props = require_text_truncate._objectWithoutProperties(_ref4, _excluded4);
|
|
100
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandEmpty, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({ className: require_text_truncate.cn("text-text-tertiary py-6 text-center text-sm", className) }, props), {}, {
|
|
101
101
|
"data-opt-id": "A8BZM",
|
|
102
102
|
"data-opt-slug": "command.CommandEmpty"
|
|
103
103
|
}));
|
|
104
104
|
}
|
|
105
105
|
/** Renders the `CommandGroup` component with an optional heading. */
|
|
106
106
|
function CommandGroup(_ref5) {
|
|
107
|
-
let { className, heading } = _ref5, props =
|
|
108
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandGroup,
|
|
107
|
+
let { className, heading } = _ref5, props = require_text_truncate._objectWithoutProperties(_ref5, _excluded5);
|
|
108
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandGroup, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({
|
|
109
109
|
heading: heading != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
110
110
|
className: "text-text-tertiary px-2 py-1.5 text-xs font-medium",
|
|
111
111
|
children: heading
|
|
112
112
|
}) : void 0,
|
|
113
|
-
className:
|
|
113
|
+
className: require_text_truncate.cn("py-1", className)
|
|
114
114
|
}, props), {}, {
|
|
115
115
|
"data-opt-id": "JPK1Y",
|
|
116
116
|
"data-opt-slug": "command.CommandGroup"
|
|
@@ -118,26 +118,26 @@ function CommandGroup(_ref5) {
|
|
|
118
118
|
}
|
|
119
119
|
/** Renders the `CommandSeparator` component. */
|
|
120
120
|
function CommandSeparator(_ref6) {
|
|
121
|
-
let { className } = _ref6, props =
|
|
122
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandSeparator,
|
|
121
|
+
let { className } = _ref6, props = require_text_truncate._objectWithoutProperties(_ref6, _excluded6);
|
|
122
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandSeparator, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({ className: require_text_truncate.cn("bg-border-subtle -mx-1 my-1 h-px", className) }, props), {}, {
|
|
123
123
|
"data-opt-id": "10P0E",
|
|
124
124
|
"data-opt-slug": "command.CommandSeparator"
|
|
125
125
|
}));
|
|
126
126
|
}
|
|
127
127
|
/** Renders the `CommandItem` component. */
|
|
128
128
|
function CommandItem(_ref7) {
|
|
129
|
-
let { className } = _ref7, props =
|
|
130
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandItem,
|
|
129
|
+
let { className } = _ref7, props = require_text_truncate._objectWithoutProperties(_ref7, _excluded7);
|
|
130
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CommandItem, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({ className: require_text_truncate.cn("text-text-primary flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm select-none", "data-[active-item]:bg-accent data-[active-item]:text-accent-fg", "data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props), {}, {
|
|
131
131
|
"data-opt-id": "K674W",
|
|
132
132
|
"data-opt-slug": "command.CommandItem"
|
|
133
133
|
}));
|
|
134
134
|
}
|
|
135
135
|
/** Renders the `CommandShortcut` component (right-aligned hint). */
|
|
136
136
|
function CommandShortcut(_ref8) {
|
|
137
|
-
let { className } = _ref8, props =
|
|
138
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span",
|
|
137
|
+
let { className } = _ref8, props = require_text_truncate._objectWithoutProperties(_ref8, _excluded8);
|
|
138
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({
|
|
139
139
|
"data-slot": "command-shortcut",
|
|
140
|
-
className:
|
|
140
|
+
className: require_text_truncate.cn("text-text-tertiary ml-auto text-xs tracking-widest", "data-[active-item]:text-accent-fg/80", className)
|
|
141
141
|
}, props), {}, {
|
|
142
142
|
"data-opt-id": "75CQK",
|
|
143
143
|
"data-opt-slug": "command.CommandShortcut"
|
|
@@ -156,7 +156,7 @@ const DEFAULT_LABELS = {
|
|
|
156
156
|
};
|
|
157
157
|
/** Renders the command palette component. */
|
|
158
158
|
function CommandPalette({ commands, open, onOpenChange, onSelect, inline = false, labels, footer, empty, inputTrailing, className }) {
|
|
159
|
-
const resolvedLabels =
|
|
159
|
+
const resolvedLabels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, DEFAULT_LABELS), labels);
|
|
160
160
|
const hasCommands = commands.length > 0;
|
|
161
161
|
const grouped = (0, react.useMemo)(() => {
|
|
162
162
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -185,7 +185,7 @@ function CommandPalette({ commands, open, onOpenChange, onSelect, inline = false
|
|
|
185
185
|
"aria-label": resolvedLabels.input,
|
|
186
186
|
placeholder: resolvedLabels.placeholder,
|
|
187
187
|
onKeyDown: handleInputKeyDown,
|
|
188
|
-
trailing: inputTrailing !== null && inputTrailing !== void 0 ? inputTrailing : !inline ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
188
|
+
trailing: inputTrailing !== null && inputTrailing !== void 0 ? inputTrailing : !inline ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Kbd, { children: resolvedLabels.escape }) : void 0
|
|
189
189
|
}),
|
|
190
190
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CommandList, {
|
|
191
191
|
"aria-label": resolvedLabels.list,
|
|
@@ -208,7 +208,7 @@ function CommandPalette({ commands, open, onOpenChange, onSelect, inline = false
|
|
|
208
208
|
if (inline) {
|
|
209
209
|
if (!open) return null;
|
|
210
210
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Command, {
|
|
211
|
-
className:
|
|
211
|
+
className: require_text_truncate.cn("border-border bg-surface w-full max-w-lg border shadow-lg", className),
|
|
212
212
|
"data-opt-id": "ATTF5",
|
|
213
213
|
"data-opt-slug": "command-palette.CommandPalette",
|
|
214
214
|
children: body
|
|
@@ -254,7 +254,7 @@ function CommandPaletteTrigger({ commands, onSelect, labels }) {
|
|
|
254
254
|
}
|
|
255
255
|
//#endregion
|
|
256
256
|
//#region src/shells/dashboard-grid.tsx
|
|
257
|
-
const defaultLabels$
|
|
257
|
+
const defaultLabels$21 = { ariaLabel: "대시보드 통계" };
|
|
258
258
|
const MIN_DASHBOARD_COLUMNS = 1;
|
|
259
259
|
const MAX_DASHBOARD_COLUMNS = 12;
|
|
260
260
|
function normalizeDashboardColumns(columns) {
|
|
@@ -263,7 +263,7 @@ function normalizeDashboardColumns(columns) {
|
|
|
263
263
|
}
|
|
264
264
|
/** Renders the dashboard grid component. */
|
|
265
265
|
function DashboardGrid({ stats, columns = 3, labels: customLabels }) {
|
|
266
|
-
const labels =
|
|
266
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$21), customLabels);
|
|
267
267
|
const columnCount = normalizeDashboardColumns(columns);
|
|
268
268
|
const rowStyle = { "--opt-dashboard-grid-columns": `repeat(${columnCount}, minmax(0, 1fr))` };
|
|
269
269
|
const rows = [];
|
|
@@ -283,7 +283,7 @@ function DashboardGrid({ stats, columns = 3, labels: customLabels }) {
|
|
|
283
283
|
children: row.map((stat) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
284
284
|
className: "data-[active-item]:ring-ring data-[active-item]:ring-offset-ring-offset data-[focus-visible]:ring-ring data-[focus-visible]:ring-offset-ring-offset rounded-xl outline-none data-[active-item]:ring-2 data-[active-item]:ring-offset-2 data-[focus-visible]:ring-2 data-[focus-visible]:ring-offset-2",
|
|
285
285
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { role: "gridcell" }),
|
|
286
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
286
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.StatCard, require_text_truncate._objectSpread2({}, stat))
|
|
287
287
|
}, stat.id))
|
|
288
288
|
}, ri))
|
|
289
289
|
})
|
|
@@ -291,13 +291,13 @@ function DashboardGrid({ stats, columns = 3, labels: customLabels }) {
|
|
|
291
291
|
}
|
|
292
292
|
//#endregion
|
|
293
293
|
//#region src/shells/search-combobox.tsx
|
|
294
|
-
const defaultLabels$
|
|
294
|
+
const defaultLabels$20 = {
|
|
295
295
|
noResults: "결과가 없습니다.",
|
|
296
296
|
loading: "Loading…"
|
|
297
297
|
};
|
|
298
298
|
/** Renders the search combobox component. */
|
|
299
299
|
function SearchCombobox({ items, placeholder = "검색...", label = "검색", onSelect, labels: customLabels, async: isAsync = false, onSearch, debounceMs = 300 }) {
|
|
300
|
-
const labels =
|
|
300
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$20), customLabels);
|
|
301
301
|
const inputId = (0, react.useId)();
|
|
302
302
|
const [query, setQuery] = (0, react.useState)("");
|
|
303
303
|
const [asyncResults, setAsyncResults] = (0, react.useState)([]);
|
|
@@ -358,33 +358,33 @@ function SearchCombobox({ items, placeholder = "검색...", label = "검색", on
|
|
|
358
358
|
className: "gap-element flex flex-col",
|
|
359
359
|
"data-opt-id": "KH4TQ",
|
|
360
360
|
"data-opt-slug": "search-combobox.SearchCombobox",
|
|
361
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
361
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.ComboboxRoot, {
|
|
362
362
|
onValueChange: handleValueChange,
|
|
363
363
|
children: [
|
|
364
364
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
365
365
|
htmlFor: inputId,
|
|
366
|
-
className:
|
|
366
|
+
className: require_text_truncate.OPT_TEXT_LABEL,
|
|
367
367
|
children: label
|
|
368
368
|
}),
|
|
369
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
369
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ComboboxInput, {
|
|
370
370
|
id: inputId,
|
|
371
371
|
placeholder,
|
|
372
372
|
className: "max-w-xs",
|
|
373
373
|
"aria-busy": loading || void 0,
|
|
374
374
|
onInput: handleInput
|
|
375
375
|
}),
|
|
376
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
376
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ComboboxPopover, {
|
|
377
377
|
className: "max-w-xs",
|
|
378
378
|
children: isAsync && loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
379
379
|
className: "text-text-secondary gap-element flex items-center px-3 py-2 text-sm",
|
|
380
380
|
role: "status",
|
|
381
381
|
"aria-live": "polite",
|
|
382
382
|
"aria-busy": "true",
|
|
383
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
383
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Spinner, {
|
|
384
384
|
size: "sm",
|
|
385
385
|
"aria-hidden": "true"
|
|
386
386
|
}), labels.loading]
|
|
387
|
-
}) : matches.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
387
|
+
}) : matches.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ComboboxEmpty, { children: labels.noResults }) : matches.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ComboboxItem, {
|
|
388
388
|
value: item,
|
|
389
389
|
children: item
|
|
390
390
|
}, item))
|
|
@@ -395,14 +395,14 @@ function SearchCombobox({ items, placeholder = "검색...", label = "검색", on
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/shells/status-select.tsx
|
|
398
|
-
const defaultLabels$
|
|
398
|
+
const defaultLabels$19 = {
|
|
399
399
|
selectLabel: "상태",
|
|
400
400
|
emptyMessage: "사용 가능한 상태 옵션이 없습니다."
|
|
401
401
|
};
|
|
402
402
|
/** Renders the status select component. */
|
|
403
403
|
function StatusSelect({ options, value: controlledValue, onChange, label, labels: customLabels }) {
|
|
404
404
|
var _options$0$value, _options$;
|
|
405
|
-
const labels =
|
|
405
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$19), customLabels);
|
|
406
406
|
const resolvedLabel = label !== null && label !== void 0 ? label : labels.selectLabel;
|
|
407
407
|
const [internalValue, setInternalValue] = (0, react.useState)((_options$0$value = (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value) !== null && _options$0$value !== void 0 ? _options$0$value : "");
|
|
408
408
|
const value = controlledValue !== null && controlledValue !== void 0 ? controlledValue : internalValue;
|
|
@@ -412,7 +412,7 @@ function StatusSelect({ options, value: controlledValue, onChange, label, labels
|
|
|
412
412
|
"data-opt-id": "R46E6",
|
|
413
413
|
"data-opt-slug": "status-select.StatusSelect",
|
|
414
414
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
415
|
-
className:
|
|
415
|
+
className: require_text_truncate.OPT_TEXT_LABEL,
|
|
416
416
|
children: resolvedLabel
|
|
417
417
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
418
418
|
className: "text-text-tertiary text-sm",
|
|
@@ -429,16 +429,16 @@ function StatusSelect({ options, value: controlledValue, onChange, label, labels
|
|
|
429
429
|
className: "gap-element flex flex-col",
|
|
430
430
|
"data-opt-id": "R46E6",
|
|
431
431
|
"data-opt-slug": "status-select.StatusSelect",
|
|
432
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
432
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectRoot, {
|
|
433
433
|
value,
|
|
434
434
|
onValueChange: handleChange,
|
|
435
435
|
children: [
|
|
436
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
437
|
-
className:
|
|
436
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectLabel, {
|
|
437
|
+
className: require_text_truncate.OPT_TEXT_LABEL,
|
|
438
438
|
children: resolvedLabel
|
|
439
439
|
}),
|
|
440
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
441
|
-
className: `${
|
|
440
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectTrigger, {
|
|
441
|
+
className: `${require_text_truncate.OPT_INPUT} max-w-xs items-center justify-between ${require_text_truncate.OPT_FOCUS}`,
|
|
442
442
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
443
443
|
className: "gap-element flex items-center",
|
|
444
444
|
children: [(selected === null || selected === void 0 ? void 0 : selected.color) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `h-2 w-2 rounded-full ${selected.color}` }), selected === null || selected === void 0 ? void 0 : selected.label]
|
|
@@ -456,9 +456,9 @@ function StatusSelect({ options, value: controlledValue, onChange, label, labels
|
|
|
456
456
|
})
|
|
457
457
|
})]
|
|
458
458
|
}),
|
|
459
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
460
|
-
className: `${
|
|
461
|
-
children: options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
459
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectPopover, {
|
|
460
|
+
className: `${require_text_truncate.OPT_SURFACE_POPOVER} ${require_text_truncate.OPT_ANIMATE_ENTER_EXIT} max-w-xs`,
|
|
461
|
+
children: options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectItem, {
|
|
462
462
|
value: option.value,
|
|
463
463
|
children: [option.color && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `h-2 w-2 rounded-full ${option.color}` }), option.label]
|
|
464
464
|
}, option.value))
|
|
@@ -469,13 +469,13 @@ function StatusSelect({ options, value: controlledValue, onChange, label, labels
|
|
|
469
469
|
}
|
|
470
470
|
//#endregion
|
|
471
471
|
//#region src/shells/app-menubar.tsx
|
|
472
|
-
const defaultLabels$
|
|
472
|
+
const defaultLabels$18 = { ariaLabel: "Application menu" };
|
|
473
473
|
function MenuSection({ menu }) {
|
|
474
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
475
|
-
if (item.type === "separator") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
474
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.MenuRoot, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.MenuTrigger, { children: [menu.label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.MenuButtonArrow, {})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.MenuPopover, { children: menu.items.map((item, i) => {
|
|
475
|
+
if (item.type === "separator") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.MenuSeparator, {}, `sep-${i}`);
|
|
476
476
|
if (item.type === "checkbox") {
|
|
477
477
|
var _item$name, _item$value;
|
|
478
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
478
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.MenuItemCheckbox, {
|
|
479
479
|
name: (_item$name = item.name) !== null && _item$name !== void 0 ? _item$name : item.id,
|
|
480
480
|
value: (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.id,
|
|
481
481
|
checked: item.checked,
|
|
@@ -491,7 +491,7 @@ function MenuSection({ menu }) {
|
|
|
491
491
|
}
|
|
492
492
|
if (item.type === "radio") {
|
|
493
493
|
var _item$name2, _item$value2;
|
|
494
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
494
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.MenuItemRadio, {
|
|
495
495
|
name: (_item$name2 = item.name) !== null && _item$name2 !== void 0 ? _item$name2 : "",
|
|
496
496
|
value: (_item$value2 = item.value) !== null && _item$value2 !== void 0 ? _item$value2 : "",
|
|
497
497
|
checked: item.checked,
|
|
@@ -505,20 +505,20 @@ function MenuSection({ menu }) {
|
|
|
505
505
|
})
|
|
506
506
|
}, item.id);
|
|
507
507
|
}
|
|
508
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
508
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.MenuItem, {
|
|
509
509
|
onClick: item.onClick,
|
|
510
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item.label }), item.shortcut && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
510
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item.label }), item.shortcut && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Kbd, { children: item.shortcut })]
|
|
511
511
|
}, item.id);
|
|
512
512
|
}) })] });
|
|
513
513
|
}
|
|
514
514
|
/** Renders the app menubar component. */
|
|
515
515
|
function AppMenubar({ menus, labels: customLabels }) {
|
|
516
|
-
const labels =
|
|
516
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$18), customLabels);
|
|
517
517
|
if (menus.length === 0) return null;
|
|
518
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
518
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.MenubarRoot, {
|
|
519
519
|
"data-opt-id": "BGKHW",
|
|
520
520
|
"data-opt-slug": "app-menubar.AppMenubar",
|
|
521
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
521
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.MenubarContainer, {
|
|
522
522
|
"aria-label": labels.ariaLabel,
|
|
523
523
|
children: menus.map((menu) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuSection, { menu }, menu.id))
|
|
524
524
|
})
|
|
@@ -552,10 +552,10 @@ const sectionStyles = {
|
|
|
552
552
|
Templates: "text-text-tertiary"
|
|
553
553
|
};
|
|
554
554
|
const defaultSectionStyle = "text-text-secondary";
|
|
555
|
-
const defaultLabels$
|
|
555
|
+
const defaultLabels$17 = { ariaLabel: "문서 네비게이션" };
|
|
556
556
|
/** Renders the sidebar nav component. */
|
|
557
557
|
function SidebarNav({ items, labels: customLabels }) {
|
|
558
|
-
const labels =
|
|
558
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$17), customLabels);
|
|
559
559
|
const pathname = (0, next_navigation.usePathname)();
|
|
560
560
|
const activeItem = items.find((item) => item.href === pathname);
|
|
561
561
|
const [activeId, setActiveId] = (0, react.useState)(activeItem ? domId(activeItem.id) : void 0);
|
|
@@ -581,18 +581,18 @@ function SidebarNav({ items, labels: customLabels }) {
|
|
|
581
581
|
const isFirstItem = index === 0;
|
|
582
582
|
const sectionTextStyle = item.sectionLabel ? (_sectionStyles$item$s = sectionStyles[item.sectionLabel]) !== null && _sectionStyles$item$s !== void 0 ? _sectionStyles$item$s : defaultSectionStyle : defaultSectionStyle;
|
|
583
583
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [item.separator && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
584
|
-
className:
|
|
584
|
+
className: require_text_truncate.cn("mb-2 pt-2", !isFirstItem && "mt-7"),
|
|
585
585
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
586
|
-
className:
|
|
586
|
+
className: require_text_truncate.cn("px-2 text-[11px] font-semibold tracking-wider uppercase", sectionTextStyle),
|
|
587
587
|
children: (_item$sectionLabel = item.sectionLabel) !== null && _item$sectionLabel !== void 0 ? _item$sectionLabel : ""
|
|
588
588
|
})
|
|
589
589
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
590
590
|
id: domId(item.id),
|
|
591
591
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(next_link.default, {
|
|
592
592
|
href: item.href,
|
|
593
|
-
className:
|
|
593
|
+
className: require_text_truncate.cn("group relative block rounded-md px-2 py-1.5 text-[13px] leading-snug outline-none", "transition-all duration-150", !isSelected && ["text-text-secondary", "hover:bg-bg-subtle hover:text-text-primary"], isSelected && ["bg-bg-subtle text-text-primary font-medium"], "data-[active-item]:bg-accent-subtle data-[active-item]:text-accent", "data-[focus-visible]:ring-ring data-[focus-visible]:ring-2", "data-[focus-visible]:ring-offset-ring-offset data-[focus-visible]:ring-offset-2", isSelected && ["data-[active-item]:bg-accent-subtle data-[active-item]:text-accent"])
|
|
594
594
|
}),
|
|
595
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className:
|
|
595
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_text_truncate.cn("absolute top-1/2 left-0 h-4 w-0.5 -translate-y-1/2 rounded-full transition-all duration-150", isSelected && "bg-accent", !isSelected && "group-data-[active-item]:bg-accent bg-transparent", "group-data-[focus-visible]:bg-accent") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
596
596
|
className: "pl-2",
|
|
597
597
|
children: item.label
|
|
598
598
|
})]
|
|
@@ -603,17 +603,17 @@ function SidebarNav({ items, labels: customLabels }) {
|
|
|
603
603
|
}
|
|
604
604
|
//#endregion
|
|
605
605
|
//#region src/shells/editor-toolbar.tsx
|
|
606
|
-
const defaultLabels$
|
|
606
|
+
const defaultLabels$16 = { ariaLabel: "텍스트 편집기 툴바" };
|
|
607
607
|
function ToolbarButtonWithTooltip({ button, active, onAction }) {
|
|
608
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
608
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.TooltipProvider, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.TooltipAnchor, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ToolbarButton, {
|
|
609
609
|
className: `text-text-primary data-[active-item]:bg-bg-subtle data-[focus-visible]:ring-ring rounded-md p-2 transition-colors outline-none data-[focus-visible]:ring-2 ${active ? "bg-bg-muted" : "hover:bg-bg-subtle"}`,
|
|
610
610
|
onClick: () => onAction === null || onAction === void 0 ? void 0 : onAction(button.id),
|
|
611
611
|
children: button.icon
|
|
612
|
-
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
612
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Tooltip, { children: button.label })] });
|
|
613
613
|
}
|
|
614
614
|
/** Renders the editor toolbar component. */
|
|
615
615
|
function EditorToolbar({ buttons, onAction, activeButtons = [], labels: customLabels }) {
|
|
616
|
-
const labels =
|
|
616
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$16), customLabels);
|
|
617
617
|
const groups = [];
|
|
618
618
|
let current = [];
|
|
619
619
|
for (const btn of buttons) {
|
|
@@ -624,14 +624,14 @@ function EditorToolbar({ buttons, onAction, activeButtons = [], labels: customLa
|
|
|
624
624
|
current.push(btn);
|
|
625
625
|
}
|
|
626
626
|
if (current.length) groups.push(current);
|
|
627
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
627
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ToolbarRoot, {
|
|
628
628
|
"data-opt-id": "Z73K6",
|
|
629
629
|
"data-opt-slug": "editor-toolbar.EditorToolbar",
|
|
630
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
630
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ToolbarContainer, {
|
|
631
631
|
"aria-label": labels.ariaLabel,
|
|
632
632
|
children: groups.map((group, gi) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
633
633
|
className: "contents",
|
|
634
|
-
children: [gi > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
634
|
+
children: [gi > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ToolbarSeparator, {}), group.map((item) => {
|
|
635
635
|
if (item === "separator") return null;
|
|
636
636
|
const btn = item;
|
|
637
637
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarButtonWithTooltip, {
|
|
@@ -646,14 +646,14 @@ function EditorToolbar({ buttons, onAction, activeButtons = [], labels: customLa
|
|
|
646
646
|
}
|
|
647
647
|
//#endregion
|
|
648
648
|
//#region src/shells/content-tabs.tsx
|
|
649
|
-
const defaultLabels$
|
|
649
|
+
const defaultLabels$15 = {
|
|
650
650
|
ariaLabel: "콘텐츠 탭",
|
|
651
651
|
emptyMessage: "표시할 탭이 없습니다."
|
|
652
652
|
};
|
|
653
653
|
/** Renders the content tabs component. */
|
|
654
654
|
function ContentTabs({ tabs, defaultTabId, labels: customLabels }) {
|
|
655
655
|
var _tabs$, _tabs$find;
|
|
656
|
-
const labels =
|
|
656
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$15), customLabels);
|
|
657
657
|
const [selectedTabId, setSelectedTabId] = (0, react.useState)(defaultTabId !== null && defaultTabId !== void 0 ? defaultTabId : (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.id);
|
|
658
658
|
if (tabs.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
659
659
|
className: "text-text-secondary text-sm",
|
|
@@ -666,18 +666,18 @@ function ContentTabs({ tabs, defaultTabId, labels: customLabels }) {
|
|
|
666
666
|
setSelectedTabId(nextId !== null && nextId !== void 0 ? nextId : (_tabs$2 = tabs[0]) === null || _tabs$2 === void 0 ? void 0 : _tabs$2.id);
|
|
667
667
|
};
|
|
668
668
|
const activeTab = (_tabs$find = tabs.find((tab) => tab.id === selectedTabId)) !== null && _tabs$find !== void 0 ? _tabs$find : tabs[0];
|
|
669
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
669
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.TabsRoot, {
|
|
670
670
|
selectedId: selectedTabId,
|
|
671
671
|
onSelectedIdChange: handleSelectedTabId,
|
|
672
672
|
"data-opt-id": "9W97K",
|
|
673
673
|
"data-opt-slug": "content-tabs.ContentTabs",
|
|
674
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
674
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.TabList, {
|
|
675
675
|
"aria-label": labels.ariaLabel,
|
|
676
|
-
children: tabs.map((tab) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
676
|
+
children: tabs.map((tab) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Tab, {
|
|
677
677
|
id: tab.id,
|
|
678
678
|
children: tab.label
|
|
679
679
|
}, tab.id))
|
|
680
|
-
}), activeTab && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
680
|
+
}), activeTab && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.TabPanel, {
|
|
681
681
|
tabId: activeTab.id,
|
|
682
682
|
children: activeTab.content
|
|
683
683
|
})]
|
|
@@ -685,13 +685,13 @@ function ContentTabs({ tabs, defaultTabId, labels: customLabels }) {
|
|
|
685
685
|
}
|
|
686
686
|
//#endregion
|
|
687
687
|
//#region src/shells/faq-accordion.tsx
|
|
688
|
-
const defaultLabels$
|
|
688
|
+
const defaultLabels$14 = {
|
|
689
689
|
ariaLabel: "자주 묻는 질문",
|
|
690
690
|
emptyMessage: "등록된 FAQ가 없습니다."
|
|
691
691
|
};
|
|
692
692
|
/** Renders the faq accordion component. */
|
|
693
693
|
function FaqAccordion({ items, labels: customLabels }) {
|
|
694
|
-
const labels =
|
|
694
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$14), customLabels);
|
|
695
695
|
if (items.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
696
696
|
className: "text-text-secondary text-sm",
|
|
697
697
|
"data-opt-id": "QRBHV",
|
|
@@ -707,8 +707,8 @@ function FaqAccordion({ items, labels: customLabels }) {
|
|
|
707
707
|
role: "region",
|
|
708
708
|
"aria-label": labels.ariaLabel,
|
|
709
709
|
className: "divide-border-subtle border-border divide-y rounded-lg border",
|
|
710
|
-
children: items.map((faq) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
711
|
-
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
710
|
+
children: items.map((faq) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DisclosureRoot, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
711
|
+
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DisclosureTrigger, {}),
|
|
712
712
|
children: [faq.question, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
713
713
|
className: "text-text-tertiary h-4 w-4 shrink-0 transition-transform [[data-open]>&]:rotate-180",
|
|
714
714
|
fill: "none",
|
|
@@ -722,7 +722,7 @@ function FaqAccordion({ items, labels: customLabels }) {
|
|
|
722
722
|
d: "m19.5 8.25-7.5 7.5-7.5-7.5"
|
|
723
723
|
})
|
|
724
724
|
})]
|
|
725
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
725
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DisclosureContent, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
726
726
|
className: "text-text-secondary px-4 pt-2 pb-4 text-sm",
|
|
727
727
|
children: faq.answer
|
|
728
728
|
}) })] }) }, faq.id))
|
|
@@ -731,14 +731,14 @@ function FaqAccordion({ items, labels: customLabels }) {
|
|
|
731
731
|
}
|
|
732
732
|
//#endregion
|
|
733
733
|
//#region src/shells/settings-form.tsx
|
|
734
|
-
const defaultLabels$
|
|
734
|
+
const defaultLabels$13 = {
|
|
735
735
|
formAriaLabel: "설정 폼",
|
|
736
736
|
submitButton: "저장",
|
|
737
737
|
successMessage: "설정이 저장되었습니다."
|
|
738
738
|
};
|
|
739
739
|
/** Renders the settings form component. */
|
|
740
740
|
function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
741
|
-
const labels =
|
|
741
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$13), customLabels);
|
|
742
742
|
const [submitted, setSubmitted] = (0, react.useState)(false);
|
|
743
743
|
const defaultValues = {};
|
|
744
744
|
for (const field of fields) {
|
|
@@ -770,7 +770,7 @@ function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
|
770
770
|
onSubmit === null || onSubmit === void 0 || onSubmit(values);
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
|
-
if (fields.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
773
|
+
if (fields.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.EmptyState, {
|
|
774
774
|
title: "설정 항목이 없습니다.",
|
|
775
775
|
description: "표시할 설정 필드를 추가하면 이 폼이 렌더링됩니다.",
|
|
776
776
|
"data-opt-id": "9TEEJ",
|
|
@@ -780,7 +780,7 @@ function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
|
780
780
|
className: "gap-group flex flex-col",
|
|
781
781
|
"data-opt-id": "9TEEJ",
|
|
782
782
|
"data-opt-slug": "settings-form.SettingsForm",
|
|
783
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
783
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.FormRoot, {
|
|
784
784
|
store: form,
|
|
785
785
|
"aria-label": labels.formAriaLabel,
|
|
786
786
|
children: [fields.map((field) => {
|
|
@@ -795,16 +795,16 @@ function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
|
795
795
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
796
796
|
className: "gap-element flex flex-col",
|
|
797
797
|
children: [
|
|
798
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
798
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormLabel, {
|
|
799
799
|
name: field.name,
|
|
800
800
|
children: field.label
|
|
801
801
|
}),
|
|
802
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
802
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.TagInput, {
|
|
803
803
|
value: tags,
|
|
804
804
|
onChange: (next) => form.setValue(field.name, next),
|
|
805
805
|
placeholder: field.placeholder
|
|
806
806
|
}),
|
|
807
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
807
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormError, { name: field.name })
|
|
808
808
|
]
|
|
809
809
|
}, field.name);
|
|
810
810
|
}
|
|
@@ -817,17 +817,17 @@ function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
|
817
817
|
className: "text-text-primary text-sm font-medium",
|
|
818
818
|
children: field.label
|
|
819
819
|
}),
|
|
820
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
820
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormRadioGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
821
821
|
className: "gap-group flex",
|
|
822
822
|
children: (_field$options = field.options) === null || _field$options === void 0 ? void 0 : _field$options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
823
823
|
className: "text-text-primary gap-element flex items-center text-sm",
|
|
824
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
824
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormRadio, {
|
|
825
825
|
name: field.name,
|
|
826
826
|
value: option.value
|
|
827
827
|
}), option.label]
|
|
828
828
|
}, option.value))
|
|
829
829
|
}) }),
|
|
830
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
830
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormError, { name: field.name })
|
|
831
831
|
]
|
|
832
832
|
}, field.name);
|
|
833
833
|
}
|
|
@@ -835,26 +835,26 @@ function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
|
835
835
|
className: "gap-element flex flex-col",
|
|
836
836
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
837
837
|
className: "text-text-primary gap-element flex items-center text-sm",
|
|
838
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
839
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
838
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormCheckbox, { name: field.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: field.label })]
|
|
839
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormError, { name: field.name })]
|
|
840
840
|
}, field.name);
|
|
841
841
|
if (field.type === "textarea") {
|
|
842
842
|
var _field$rows, _field$resize;
|
|
843
843
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
844
844
|
className: "gap-element flex flex-col",
|
|
845
845
|
children: [
|
|
846
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
846
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormLabel, {
|
|
847
847
|
name: field.name,
|
|
848
848
|
children: field.label
|
|
849
849
|
}),
|
|
850
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
850
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormTextarea, {
|
|
851
851
|
name: field.name,
|
|
852
852
|
placeholder: field.placeholder,
|
|
853
853
|
rows: (_field$rows = field.rows) !== null && _field$rows !== void 0 ? _field$rows : 4,
|
|
854
854
|
resize: (_field$resize = field.resize) !== null && _field$resize !== void 0 ? _field$resize : "vertical",
|
|
855
855
|
className: field.font === "mono" ? "font-mono text-sm" : void 0
|
|
856
856
|
}),
|
|
857
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
857
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormError, { name: field.name })
|
|
858
858
|
]
|
|
859
859
|
}, field.name);
|
|
860
860
|
}
|
|
@@ -863,25 +863,25 @@ function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
|
863
863
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
864
864
|
className: "gap-element flex flex-col",
|
|
865
865
|
children: [
|
|
866
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
866
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormLabel, {
|
|
867
867
|
name: field.name,
|
|
868
868
|
children: field.label
|
|
869
869
|
}),
|
|
870
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
870
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormSelect, {
|
|
871
871
|
name: field.name,
|
|
872
872
|
placeholder: field.placeholder,
|
|
873
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
873
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormSelectPopover, { children: (_field$options2 = field.options) === null || _field$options2 === void 0 ? void 0 : _field$options2.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormSelectItem, {
|
|
874
874
|
value: option.value,
|
|
875
875
|
children: option.label
|
|
876
876
|
}, option.value)) })
|
|
877
877
|
}),
|
|
878
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
878
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormError, { name: field.name })
|
|
879
879
|
]
|
|
880
880
|
}, field.name);
|
|
881
881
|
}
|
|
882
882
|
if (field.type === "switch") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
883
883
|
className: "gap-group flex items-center",
|
|
884
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
884
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormSwitch, { name: field.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
885
885
|
className: "flex flex-col",
|
|
886
886
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
887
887
|
className: "text-text-primary text-sm font-medium",
|
|
@@ -895,19 +895,19 @@ function SettingsForm({ fields, onSubmit, labels: customLabels }) {
|
|
|
895
895
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
896
896
|
className: "gap-element flex flex-col",
|
|
897
897
|
children: [
|
|
898
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
898
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormLabel, {
|
|
899
899
|
name: field.name,
|
|
900
900
|
children: field.label
|
|
901
901
|
}),
|
|
902
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
902
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormInput, {
|
|
903
903
|
name: field.name,
|
|
904
904
|
type: (_field$type = field.type) !== null && _field$type !== void 0 ? _field$type : "text",
|
|
905
905
|
placeholder: field.placeholder
|
|
906
906
|
}),
|
|
907
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
907
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormError, { name: field.name })
|
|
908
908
|
]
|
|
909
909
|
}, field.name);
|
|
910
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
910
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FormSubmit, { children: labels.submitButton })]
|
|
911
911
|
}), submitted && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
912
912
|
className: "border-success bg-success-subtle text-success-fg rounded-lg border p-3 text-sm",
|
|
913
913
|
children: labels.successMessage
|
|
@@ -925,17 +925,17 @@ const statusIcon = {
|
|
|
925
925
|
};
|
|
926
926
|
const statusColor = {
|
|
927
927
|
success: "text-success-fg",
|
|
928
|
-
pending:
|
|
928
|
+
pending: require_text_truncate.OPT_TEXT_TERTIARY,
|
|
929
929
|
running: "text-accent",
|
|
930
930
|
error: "text-danger-fg",
|
|
931
931
|
skipped: "text-text-tertiary"
|
|
932
932
|
};
|
|
933
933
|
const statusBadge$1 = {
|
|
934
|
-
success:
|
|
935
|
-
pending:
|
|
934
|
+
success: require_text_truncate.OPT_BADGE_GREEN,
|
|
935
|
+
pending: require_text_truncate.OPT_BADGE_NEUTRAL,
|
|
936
936
|
running: "inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium bg-info-subtle text-info-fg",
|
|
937
|
-
error:
|
|
938
|
-
skipped:
|
|
937
|
+
error: require_text_truncate.OPT_BADGE_RED,
|
|
938
|
+
skipped: require_text_truncate.OPT_BADGE_NEUTRAL
|
|
939
939
|
};
|
|
940
940
|
const statusLabel$1 = {
|
|
941
941
|
success: "성공",
|
|
@@ -963,7 +963,7 @@ function DeploymentTimeline({ steps, title = "배포 타임라인" }) {
|
|
|
963
963
|
children: steps.map((step, i) => {
|
|
964
964
|
const isLast = i === steps.length - 1;
|
|
965
965
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
966
|
-
className: `group gap-group relative flex w-full scroll-m-2 rounded-lg px-3 py-2 ${
|
|
966
|
+
className: `group gap-group relative flex w-full scroll-m-2 rounded-lg px-3 py-2 ${require_text_truncate.OPT_FOCUS} data-[active-item]:bg-accent-subtle`,
|
|
967
967
|
role: "listitem",
|
|
968
968
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
969
969
|
className: "flex flex-col items-center",
|
|
@@ -978,7 +978,7 @@ function DeploymentTimeline({ steps, title = "배포 타임라인" }) {
|
|
|
978
978
|
className: "gap-element flex items-center",
|
|
979
979
|
children: [
|
|
980
980
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
981
|
-
className: `text-sm font-medium ${
|
|
981
|
+
className: `text-sm font-medium ${require_text_truncate.OPT_TEXT_PRIMARY}`,
|
|
982
982
|
children: step.name
|
|
983
983
|
}),
|
|
984
984
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1004,9 +1004,9 @@ function DeploymentTimeline({ steps, title = "배포 타임라인" }) {
|
|
|
1004
1004
|
//#endregion
|
|
1005
1005
|
//#region src/shells/project-switcher.tsx
|
|
1006
1006
|
const statusDot = {
|
|
1007
|
-
active:
|
|
1008
|
-
paused:
|
|
1009
|
-
error:
|
|
1007
|
+
active: require_text_truncate.OPT_DOT_GREEN,
|
|
1008
|
+
paused: require_text_truncate.OPT_DOT_YELLOW,
|
|
1009
|
+
error: require_text_truncate.OPT_DOT_RED
|
|
1010
1010
|
};
|
|
1011
1011
|
/** Renders the project switcher component. */
|
|
1012
1012
|
function ProjectSwitcher({ projects, value, onChange, placeholder = "프로젝트 검색..." }) {
|
|
@@ -1020,26 +1020,26 @@ function ProjectSwitcher({ projects, value, onChange, placeholder = "프로젝
|
|
|
1020
1020
|
className: "gap-element flex flex-col",
|
|
1021
1021
|
"data-opt-id": "5R3AG",
|
|
1022
1022
|
"data-opt-slug": "project-switcher.ProjectSwitcher",
|
|
1023
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1023
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.ComboboxRoot, {
|
|
1024
1024
|
onValueChange: setSearch,
|
|
1025
1025
|
children: [
|
|
1026
1026
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1027
|
-
className:
|
|
1027
|
+
className: require_text_truncate.OPT_TEXT_LABEL,
|
|
1028
1028
|
children: "프로젝트"
|
|
1029
1029
|
}),
|
|
1030
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1030
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.ComboboxInput, {
|
|
1031
1031
|
placeholder: selected ? selected.name : placeholder,
|
|
1032
|
-
className:
|
|
1032
|
+
className: require_text_truncate.OPT_INPUT
|
|
1033
1033
|
}),
|
|
1034
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1034
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.ComboboxPopover, {
|
|
1035
1035
|
className: "max-h-72 overflow-y-auto",
|
|
1036
1036
|
children: [matches.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1037
1037
|
className: `py-6 text-center text-sm text-text-secondary`,
|
|
1038
1038
|
children: "결과가 없습니다."
|
|
1039
|
-
}), matches.map((project) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1039
|
+
}), matches.map((project) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.ComboboxItem, {
|
|
1040
1040
|
value: project.name,
|
|
1041
1041
|
onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange(project.id),
|
|
1042
|
-
className: `gap-element flex scroll-m-2 items-center ${
|
|
1042
|
+
className: `gap-element flex scroll-m-2 items-center ${require_text_truncate.OPT_ITEM_BASE} ${require_text_truncate.OPT_ACTIVE_ITEM}`,
|
|
1043
1043
|
children: [
|
|
1044
1044
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `shrink-0 ${statusDot[project.status]}` }),
|
|
1045
1045
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1047,7 +1047,7 @@ function ProjectSwitcher({ projects, value, onChange, placeholder = "프로젝
|
|
|
1047
1047
|
children: project.name
|
|
1048
1048
|
}),
|
|
1049
1049
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1050
|
-
className:
|
|
1050
|
+
className: require_text_truncate.OPT_BADGE_NEUTRAL,
|
|
1051
1051
|
children: project.framework
|
|
1052
1052
|
}),
|
|
1053
1053
|
project.domain && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1064,29 +1064,29 @@ function ProjectSwitcher({ projects, value, onChange, placeholder = "프로젝
|
|
|
1064
1064
|
ProjectSwitcher.displayName = "ProjectSwitcher";
|
|
1065
1065
|
//#endregion
|
|
1066
1066
|
//#region src/shells/env-panel.tsx
|
|
1067
|
-
const defaultLabels$
|
|
1067
|
+
const defaultLabels$12 = {
|
|
1068
1068
|
varCount: (count) => `${count}개 변수`,
|
|
1069
1069
|
envVarsLabel: (env) => `${env} 환경 변수`,
|
|
1070
1070
|
secretBadge: "secret"
|
|
1071
1071
|
};
|
|
1072
1072
|
const envDot = {
|
|
1073
|
-
Production:
|
|
1074
|
-
Preview:
|
|
1075
|
-
Development:
|
|
1073
|
+
Production: require_text_truncate.OPT_DOT_RED,
|
|
1074
|
+
Preview: require_text_truncate.OPT_DOT_YELLOW,
|
|
1075
|
+
Development: require_text_truncate.OPT_DOT_GREEN
|
|
1076
1076
|
};
|
|
1077
1077
|
/** Renders the env panel component. */
|
|
1078
1078
|
function EnvPanel({ groups, labels: customLabels }) {
|
|
1079
|
-
const labels =
|
|
1079
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$12), customLabels);
|
|
1080
1080
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1081
|
-
className: `rounded-lg ${
|
|
1081
|
+
className: `rounded-lg ${require_text_truncate.OPT_BORDER} divide-y ${require_text_truncate.OPT_DIVIDER} bg-surface`,
|
|
1082
1082
|
"data-opt-id": "ZBDWK",
|
|
1083
1083
|
"data-opt-slug": "env-panel.EnvPanel",
|
|
1084
1084
|
children: groups.map((group) => {
|
|
1085
1085
|
var _envDot$group$env;
|
|
1086
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1086
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DisclosureRoot, {
|
|
1087
1087
|
defaultOpen: group.env === "Production",
|
|
1088
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1089
|
-
className:
|
|
1088
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.DisclosureTrigger, {
|
|
1089
|
+
className: require_text_truncate.OPT_DISCLOSURE_TRIGGER,
|
|
1090
1090
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1091
1091
|
className: "gap-element flex items-center",
|
|
1092
1092
|
children: [
|
|
@@ -1096,7 +1096,7 @@ function EnvPanel({ groups, labels: customLabels }) {
|
|
|
1096
1096
|
children: group.env
|
|
1097
1097
|
}),
|
|
1098
1098
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1099
|
-
className: `text-xs ${
|
|
1099
|
+
className: `text-xs ${require_text_truncate.OPT_TEXT_TERTIARY}`,
|
|
1100
1100
|
children: labels.varCount(group.vars.length)
|
|
1101
1101
|
})
|
|
1102
1102
|
]
|
|
@@ -1113,8 +1113,8 @@ function EnvPanel({ groups, labels: customLabels }) {
|
|
|
1113
1113
|
d: "m19.5 8.25-7.5 7.5-7.5-7.5"
|
|
1114
1114
|
})
|
|
1115
1115
|
})]
|
|
1116
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1117
|
-
className:
|
|
1116
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.DisclosureContent, {
|
|
1117
|
+
className: require_text_truncate.OPT_DISCLOSURE_CONTENT,
|
|
1118
1118
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeProvider, {
|
|
1119
1119
|
focusLoop: true,
|
|
1120
1120
|
orientation: "vertical",
|
|
@@ -1124,18 +1124,18 @@ function EnvPanel({ groups, labels: customLabels }) {
|
|
|
1124
1124
|
className: "px-4 pb-3",
|
|
1125
1125
|
children: group.vars.map((v) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1126
1126
|
role: "listitem",
|
|
1127
|
-
className: `gap-group flex scroll-m-2 items-center rounded px-2 py-1.5 text-sm ${
|
|
1127
|
+
className: `gap-group flex scroll-m-2 items-center rounded px-2 py-1.5 text-sm ${require_text_truncate.OPT_FOCUS} data-[active-item]:bg-accent-subtle`,
|
|
1128
1128
|
children: [
|
|
1129
1129
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1130
|
-
className: `w-44 shrink-0 truncate font-mono text-xs font-medium ${
|
|
1130
|
+
className: `w-44 shrink-0 truncate font-mono text-xs font-medium ${require_text_truncate.OPT_TEXT_PRIMARY}`,
|
|
1131
1131
|
children: v.key
|
|
1132
1132
|
}),
|
|
1133
1133
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1134
|
-
className: `flex-1 truncate font-mono text-xs ${
|
|
1134
|
+
className: `flex-1 truncate font-mono text-xs ${require_text_truncate.OPT_TEXT_SECONDARY}`,
|
|
1135
1135
|
children: v.isSecret ? "••••••••" : v.value
|
|
1136
1136
|
}),
|
|
1137
1137
|
v.isSecret && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1138
|
-
className:
|
|
1138
|
+
className: require_text_truncate.OPT_BADGE_NEUTRAL,
|
|
1139
1139
|
children: labels.secretBadge
|
|
1140
1140
|
})
|
|
1141
1141
|
]
|
|
@@ -1149,7 +1149,7 @@ function EnvPanel({ groups, labels: customLabels }) {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
//#endregion
|
|
1151
1151
|
//#region src/shells/branch-select.tsx
|
|
1152
|
-
const defaultLabels$
|
|
1152
|
+
const defaultLabels$11 = {
|
|
1153
1153
|
selectLabel: "브랜치",
|
|
1154
1154
|
emptySelectionLabel: "선택...",
|
|
1155
1155
|
emptyMessage: "사용 가능한 브랜치가 없습니다.",
|
|
@@ -1158,7 +1158,7 @@ const defaultLabels$8 = {
|
|
|
1158
1158
|
/** Renders the branch select component. */
|
|
1159
1159
|
function BranchSelect({ branches, value: controlledValue, onChange, label, labels: customLabels }) {
|
|
1160
1160
|
var _ref, _defaultBranch$name, _branches$, _selected$name;
|
|
1161
|
-
const labels =
|
|
1161
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$11), customLabels);
|
|
1162
1162
|
const resolvedLabel = label !== null && label !== void 0 ? label : labels.selectLabel;
|
|
1163
1163
|
const defaultBranch = branches.find((b) => b.isDefault);
|
|
1164
1164
|
const [internalValue, setInternalValue] = (0, react.useState)((_ref = (_defaultBranch$name = defaultBranch === null || defaultBranch === void 0 ? void 0 : defaultBranch.name) !== null && _defaultBranch$name !== void 0 ? _defaultBranch$name : (_branches$ = branches[0]) === null || _branches$ === void 0 ? void 0 : _branches$.name) !== null && _ref !== void 0 ? _ref : "");
|
|
@@ -1169,10 +1169,10 @@ function BranchSelect({ branches, value: controlledValue, onChange, label, label
|
|
|
1169
1169
|
"data-opt-id": "7EDEP",
|
|
1170
1170
|
"data-opt-slug": "branch-select.BranchSelect",
|
|
1171
1171
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1172
|
-
className:
|
|
1172
|
+
className: require_text_truncate.OPT_TEXT_LABEL,
|
|
1173
1173
|
children: resolvedLabel
|
|
1174
1174
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1175
|
-
className:
|
|
1175
|
+
className: require_text_truncate.OPT_TEXT_TERTIARY,
|
|
1176
1176
|
children: labels.emptyMessage
|
|
1177
1177
|
})]
|
|
1178
1178
|
});
|
|
@@ -1186,16 +1186,16 @@ function BranchSelect({ branches, value: controlledValue, onChange, label, label
|
|
|
1186
1186
|
className: "gap-element flex flex-col",
|
|
1187
1187
|
"data-opt-id": "7EDEP",
|
|
1188
1188
|
"data-opt-slug": "branch-select.BranchSelect",
|
|
1189
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1189
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectRoot, {
|
|
1190
1190
|
value,
|
|
1191
1191
|
onValueChange: handleChange,
|
|
1192
1192
|
children: [
|
|
1193
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1194
|
-
className:
|
|
1193
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectLabel, {
|
|
1194
|
+
className: require_text_truncate.OPT_TEXT_LABEL,
|
|
1195
1195
|
children: resolvedLabel
|
|
1196
1196
|
}),
|
|
1197
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1198
|
-
className: `${
|
|
1197
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectTrigger, {
|
|
1198
|
+
className: `${require_text_truncate.OPT_INPUT} max-w-xs items-center justify-between gap-1`,
|
|
1199
1199
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1200
1200
|
className: "gap-element flex items-center truncate",
|
|
1201
1201
|
children: [
|
|
@@ -1217,7 +1217,7 @@ function BranchSelect({ branches, value: controlledValue, onChange, label, label
|
|
|
1217
1217
|
children: (_selected$name = selected === null || selected === void 0 ? void 0 : selected.name) !== null && _selected$name !== void 0 ? _selected$name : labels.emptySelectionLabel
|
|
1218
1218
|
}),
|
|
1219
1219
|
(selected === null || selected === void 0 ? void 0 : selected.isDefault) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1220
|
-
className:
|
|
1220
|
+
className: require_text_truncate.OPT_BADGE_BLUE,
|
|
1221
1221
|
children: labels.defaultBadge
|
|
1222
1222
|
})
|
|
1223
1223
|
]
|
|
@@ -1235,11 +1235,11 @@ function BranchSelect({ branches, value: controlledValue, onChange, label, label
|
|
|
1235
1235
|
})
|
|
1236
1236
|
})]
|
|
1237
1237
|
}),
|
|
1238
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1238
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectPopover, {
|
|
1239
1239
|
className: "max-w-xs",
|
|
1240
|
-
children: branches.map((branch) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1240
|
+
children: branches.map((branch) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectItem, {
|
|
1241
1241
|
value: branch.name,
|
|
1242
|
-
className: `gap-element flex scroll-m-2 items-center ${
|
|
1242
|
+
className: `gap-element flex scroll-m-2 items-center ${require_text_truncate.OPT_ITEM_BASE} ${require_text_truncate.OPT_ACTIVE_ITEM}`,
|
|
1243
1243
|
children: [
|
|
1244
1244
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1245
1245
|
className: "flex-1 truncate",
|
|
@@ -1267,7 +1267,7 @@ function BranchSelect({ branches, value: controlledValue, onChange, label, label
|
|
|
1267
1267
|
BranchSelect.displayName = "BranchSelect";
|
|
1268
1268
|
//#endregion
|
|
1269
1269
|
//#region src/shells/domain-table.tsx
|
|
1270
|
-
const defaultLabels$
|
|
1270
|
+
const defaultLabels$10 = {
|
|
1271
1271
|
domain: "Domain",
|
|
1272
1272
|
status: "Status",
|
|
1273
1273
|
ssl: "SSL",
|
|
@@ -1276,14 +1276,14 @@ const defaultLabels$7 = {
|
|
|
1276
1276
|
emptyMessage: "No domains configured"
|
|
1277
1277
|
};
|
|
1278
1278
|
const statusBadge = {
|
|
1279
|
-
active:
|
|
1280
|
-
pending:
|
|
1281
|
-
error:
|
|
1279
|
+
active: require_text_truncate.OPT_BADGE_GREEN,
|
|
1280
|
+
pending: require_text_truncate.OPT_BADGE_YELLOW,
|
|
1281
|
+
error: require_text_truncate.OPT_BADGE_RED
|
|
1282
1282
|
};
|
|
1283
1283
|
const sslBadge = {
|
|
1284
|
-
valid:
|
|
1285
|
-
pending:
|
|
1286
|
-
expired:
|
|
1284
|
+
valid: require_text_truncate.OPT_BADGE_GREEN,
|
|
1285
|
+
pending: require_text_truncate.OPT_BADGE_YELLOW,
|
|
1286
|
+
expired: require_text_truncate.OPT_BADGE_RED
|
|
1287
1287
|
};
|
|
1288
1288
|
const statusLabel = {
|
|
1289
1289
|
active: "Active",
|
|
@@ -1297,7 +1297,7 @@ const sslLabel = {
|
|
|
1297
1297
|
};
|
|
1298
1298
|
/** Renders the domain table component. */
|
|
1299
1299
|
function DomainTable({ domains, title = "도메인", labels: customLabels }) {
|
|
1300
|
-
const labels =
|
|
1300
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$10), customLabels);
|
|
1301
1301
|
if (domains.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1302
1302
|
className: "gap-group flex flex-col",
|
|
1303
1303
|
"data-opt-id": "A7SRM",
|
|
@@ -1306,7 +1306,7 @@ function DomainTable({ domains, title = "도메인", labels: customLabels }) {
|
|
|
1306
1306
|
className: `text-sm font-semibold text-text-primary`,
|
|
1307
1307
|
children: title
|
|
1308
1308
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1309
|
-
className: `rounded-lg px-4 py-6 text-sm ${
|
|
1309
|
+
className: `rounded-lg px-4 py-6 text-sm ${require_text_truncate.OPT_BORDER} ${require_text_truncate.OPT_TEXT_SECONDARY} bg-surface`,
|
|
1310
1310
|
children: labels.emptyMessage
|
|
1311
1311
|
})]
|
|
1312
1312
|
});
|
|
@@ -1318,7 +1318,7 @@ function DomainTable({ domains, title = "도메인", labels: customLabels }) {
|
|
|
1318
1318
|
className: `text-sm font-semibold text-text-primary`,
|
|
1319
1319
|
children: title
|
|
1320
1320
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1321
|
-
className: `overflow-x-auto rounded-lg ${
|
|
1321
|
+
className: `overflow-x-auto rounded-lg ${require_text_truncate.OPT_BORDER} bg-surface`,
|
|
1322
1322
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeProvider, {
|
|
1323
1323
|
focusLoop: true,
|
|
1324
1324
|
focusWrap: true,
|
|
@@ -1331,28 +1331,28 @@ function DomainTable({ domains, title = "도메인", labels: customLabels }) {
|
|
|
1331
1331
|
className: "border-border-subtle bg-surface-inset border-b",
|
|
1332
1332
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
1333
1333
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1334
|
-
className:
|
|
1334
|
+
className: require_text_truncate.OPT_TH,
|
|
1335
1335
|
children: labels.domain
|
|
1336
1336
|
}),
|
|
1337
1337
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1338
|
-
className:
|
|
1338
|
+
className: require_text_truncate.OPT_TH,
|
|
1339
1339
|
children: labels.status
|
|
1340
1340
|
}),
|
|
1341
1341
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1342
|
-
className:
|
|
1342
|
+
className: require_text_truncate.OPT_TH,
|
|
1343
1343
|
children: labels.ssl
|
|
1344
1344
|
}),
|
|
1345
1345
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1346
|
-
className:
|
|
1346
|
+
className: require_text_truncate.OPT_TH,
|
|
1347
1347
|
children: labels.redirect
|
|
1348
1348
|
}),
|
|
1349
1349
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1350
|
-
className:
|
|
1350
|
+
className: require_text_truncate.OPT_TH,
|
|
1351
1351
|
children: labels.added
|
|
1352
1352
|
})
|
|
1353
1353
|
] })
|
|
1354
1354
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", {
|
|
1355
|
-
className: `divide-y ${
|
|
1355
|
+
className: `divide-y ${require_text_truncate.OPT_DIVIDER}`,
|
|
1356
1356
|
children: domains.map((d) => {
|
|
1357
1357
|
var _d$redirect, _d$addedAt;
|
|
1358
1358
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeRow, {
|
|
@@ -1360,18 +1360,18 @@ function DomainTable({ domains, title = "도메인", labels: customLabels }) {
|
|
|
1360
1360
|
children: [
|
|
1361
1361
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1362
1362
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1363
|
-
className: `${
|
|
1363
|
+
className: `${require_text_truncate.OPT_TD} font-mono font-medium`,
|
|
1364
1364
|
role: "gridcell"
|
|
1365
1365
|
}),
|
|
1366
|
-
className:
|
|
1366
|
+
className: require_text_truncate.OPT_TABLE_ROW_ACTIVE,
|
|
1367
1367
|
children: d.domain
|
|
1368
1368
|
}),
|
|
1369
1369
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1370
1370
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1371
|
-
className:
|
|
1371
|
+
className: require_text_truncate.OPT_TD,
|
|
1372
1372
|
role: "gridcell"
|
|
1373
1373
|
}),
|
|
1374
|
-
className:
|
|
1374
|
+
className: require_text_truncate.OPT_TABLE_ROW_ACTIVE,
|
|
1375
1375
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1376
1376
|
className: statusBadge[d.status],
|
|
1377
1377
|
children: statusLabel[d.status]
|
|
@@ -1379,10 +1379,10 @@ function DomainTable({ domains, title = "도메인", labels: customLabels }) {
|
|
|
1379
1379
|
}),
|
|
1380
1380
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1381
1381
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1382
|
-
className:
|
|
1382
|
+
className: require_text_truncate.OPT_TD,
|
|
1383
1383
|
role: "gridcell"
|
|
1384
1384
|
}),
|
|
1385
|
-
className:
|
|
1385
|
+
className: require_text_truncate.OPT_TABLE_ROW_ACTIVE,
|
|
1386
1386
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1387
1387
|
className: sslBadge[d.ssl],
|
|
1388
1388
|
children: sslLabel[d.ssl]
|
|
@@ -1390,18 +1390,18 @@ function DomainTable({ domains, title = "도메인", labels: customLabels }) {
|
|
|
1390
1390
|
}),
|
|
1391
1391
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1392
1392
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1393
|
-
className:
|
|
1393
|
+
className: require_text_truncate.OPT_TD,
|
|
1394
1394
|
role: "gridcell"
|
|
1395
1395
|
}),
|
|
1396
|
-
className:
|
|
1396
|
+
className: require_text_truncate.OPT_TABLE_ROW_ACTIVE,
|
|
1397
1397
|
children: (_d$redirect = d.redirect) !== null && _d$redirect !== void 0 ? _d$redirect : "—"
|
|
1398
1398
|
}),
|
|
1399
1399
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1400
1400
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1401
|
-
className:
|
|
1401
|
+
className: require_text_truncate.OPT_TD_MUTED,
|
|
1402
1402
|
role: "gridcell"
|
|
1403
1403
|
}),
|
|
1404
|
-
className:
|
|
1404
|
+
className: require_text_truncate.OPT_TABLE_ROW_ACTIVE,
|
|
1405
1405
|
children: (_d$addedAt = d.addedAt) !== null && _d$addedAt !== void 0 ? _d$addedAt : "—"
|
|
1406
1406
|
})
|
|
1407
1407
|
]
|
|
@@ -1469,7 +1469,7 @@ function DataTableProgressBar({ value, barColor, label }) {
|
|
|
1469
1469
|
"aria-valuetext": `${percent}%`,
|
|
1470
1470
|
"aria-label": label,
|
|
1471
1471
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1472
|
-
className:
|
|
1472
|
+
className: require_text_truncate.cn("h-full rounded-full transition-all", barColor),
|
|
1473
1473
|
style: { width: `${percent}%` }
|
|
1474
1474
|
})
|
|
1475
1475
|
});
|
|
@@ -1551,18 +1551,18 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1551
1551
|
};
|
|
1552
1552
|
const colCount = columns.length + (selectable ? 1 : 0) + (expandable ? 1 : 0);
|
|
1553
1553
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1554
|
-
className:
|
|
1554
|
+
className: require_text_truncate.cn("gap-group flex flex-col", className),
|
|
1555
1555
|
"data-opt-id": "J1KN4",
|
|
1556
1556
|
"data-opt-slug": "data-table.DataTable",
|
|
1557
1557
|
children: [
|
|
1558
1558
|
title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
1559
|
-
className:
|
|
1559
|
+
className: require_text_truncate.cn("text-sm font-semibold", "text-text-primary"),
|
|
1560
1560
|
children: title
|
|
1561
1561
|
}),
|
|
1562
1562
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1563
|
-
className:
|
|
1563
|
+
className: require_text_truncate.cn("overflow-x-auto rounded-lg", require_text_truncate.OPT_BORDER, "bg-surface"),
|
|
1564
1564
|
children: data.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1565
|
-
className:
|
|
1565
|
+
className: require_text_truncate.cn("px-4 py-8 text-center text-sm", require_text_truncate.OPT_TEXT_SECONDARY),
|
|
1566
1566
|
children: emptyMessage
|
|
1567
1567
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeProvider, {
|
|
1568
1568
|
focusLoop: true,
|
|
@@ -1573,24 +1573,24 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1573
1573
|
className: "w-full",
|
|
1574
1574
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {}),
|
|
1575
1575
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", {
|
|
1576
|
-
className:
|
|
1576
|
+
className: require_text_truncate.cn("border-border-subtle bg-surface-inset border-b", stickyHeader && "sticky top-0 z-10"),
|
|
1577
1577
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
|
|
1578
1578
|
selectable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
1579
|
-
className:
|
|
1580
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1579
|
+
className: require_text_truncate.cn("px-3 py-2.5 text-left text-xs font-semibold uppercase tracking-wider text-text-tertiary", "w-10"),
|
|
1580
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Checkbox, {
|
|
1581
1581
|
checked: allSelected,
|
|
1582
1582
|
onChange: toggleSelectAll,
|
|
1583
1583
|
"aria-label": "Select all"
|
|
1584
1584
|
})
|
|
1585
1585
|
}),
|
|
1586
|
-
expandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { className:
|
|
1586
|
+
expandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { className: require_text_truncate.cn("px-3 py-2.5 text-left text-xs font-semibold uppercase tracking-wider text-text-tertiary", "w-10") }),
|
|
1587
1587
|
columns.map((col) => {
|
|
1588
1588
|
var _col$align;
|
|
1589
1589
|
const isSortable = sortable && col.sortable !== false;
|
|
1590
1590
|
const resizeValue = getResizeHandleValue(colWidths[col.id], col.width);
|
|
1591
1591
|
const resizeMax = Math.max(DEFAULT_COLUMN_RESIZE_MAX, resizeValue);
|
|
1592
1592
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("th", {
|
|
1593
|
-
className:
|
|
1593
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TH, "relative", alignmentClass[(_col$align = col.align) !== null && _col$align !== void 0 ? _col$align : "left"], isSortable && "hover:text-text-primary cursor-pointer select-none", isSortable && "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-ring-offset"),
|
|
1594
1594
|
style: { width: colWidths[col.id] || col.width || void 0 },
|
|
1595
1595
|
onClick: isSortable ? () => handleSort(col.id) : void 0,
|
|
1596
1596
|
onKeyDown: (event) => {
|
|
@@ -1618,14 +1618,14 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1618
1618
|
e.preventDefault();
|
|
1619
1619
|
e.stopPropagation();
|
|
1620
1620
|
if (e.key === "Home" || e.key === "End") {
|
|
1621
|
-
setColWidths((prev) =>
|
|
1621
|
+
setColWidths((prev) => require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, prev), {}, { [col.id]: e.key === "Home" ? MIN_COLUMN_WIDTH : resizeMax }));
|
|
1622
1622
|
return;
|
|
1623
1623
|
}
|
|
1624
1624
|
const delta = e.shiftKey ? 40 : 10;
|
|
1625
1625
|
const direction = e.key === "ArrowRight" ? 1 : -1;
|
|
1626
1626
|
setColWidths((prev) => {
|
|
1627
1627
|
const current = getResizeHandleValue(prev[col.id], col.width);
|
|
1628
|
-
return
|
|
1628
|
+
return require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, prev), {}, { [col.id]: Math.max(MIN_COLUMN_WIDTH, current + direction * delta) });
|
|
1629
1629
|
});
|
|
1630
1630
|
},
|
|
1631
1631
|
onMouseDown: (e) => {
|
|
@@ -1635,7 +1635,7 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1635
1635
|
const startW = e.target.parentElement.offsetWidth;
|
|
1636
1636
|
const onMove = (ev) => {
|
|
1637
1637
|
const newW = Math.max(MIN_COLUMN_WIDTH, startW + ev.clientX - startX);
|
|
1638
|
-
setColWidths((prev) =>
|
|
1638
|
+
setColWidths((prev) => require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, prev), {}, { [col.id]: newW }));
|
|
1639
1639
|
};
|
|
1640
1640
|
const onUp = () => {
|
|
1641
1641
|
document.removeEventListener("mousemove", onMove);
|
|
@@ -1649,24 +1649,24 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1649
1649
|
})
|
|
1650
1650
|
] })
|
|
1651
1651
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", {
|
|
1652
|
-
className:
|
|
1652
|
+
className: require_text_truncate.cn("divide-y", require_text_truncate.OPT_DIVIDER),
|
|
1653
1653
|
children: pagedData.map((row) => {
|
|
1654
1654
|
const key = keyExtractor(row);
|
|
1655
1655
|
const isExpanded = expandedKeys.has(key);
|
|
1656
1656
|
const isSelected = selectedSet.has(key);
|
|
1657
1657
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeRow, {
|
|
1658
1658
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
1659
|
-
className:
|
|
1659
|
+
className: require_text_truncate.cn(onRowClick ? "cursor-pointer" : void 0, (isSelected || activeRowId === key) && "bg-accent-subtle"),
|
|
1660
1660
|
onClick: onRowClick ? () => onRowClick(row) : void 0
|
|
1661
1661
|
}),
|
|
1662
1662
|
children: [
|
|
1663
1663
|
selectable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1664
1664
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1665
|
-
className:
|
|
1665
|
+
className: require_text_truncate.cn("px-3 py-2.5 text-sm text-text-primary whitespace-nowrap", "w-10"),
|
|
1666
1666
|
role: "gridcell"
|
|
1667
1667
|
}),
|
|
1668
1668
|
className: "outline-none data-[active-item]:bg-accent-subtle data-[focus-visible]:outline-2 data-[focus-visible]:outline-ring data-[focus-visible]:-outline-offset-1",
|
|
1669
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1669
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Checkbox, {
|
|
1670
1670
|
checked: isSelected,
|
|
1671
1671
|
onChange: () => toggleSelectRow(key),
|
|
1672
1672
|
"aria-label": `Select row ${key}`
|
|
@@ -1674,7 +1674,7 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1674
1674
|
}),
|
|
1675
1675
|
expandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1676
1676
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1677
|
-
className:
|
|
1677
|
+
className: require_text_truncate.cn("px-3 py-2.5 text-sm text-text-primary whitespace-nowrap", "w-10"),
|
|
1678
1678
|
role: "gridcell"
|
|
1679
1679
|
}),
|
|
1680
1680
|
className: "outline-none data-[active-item]:bg-accent-subtle data-[focus-visible]:outline-2 data-[focus-visible]:outline-ring data-[focus-visible]:-outline-offset-1",
|
|
@@ -1684,7 +1684,7 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1684
1684
|
e.stopPropagation();
|
|
1685
1685
|
toggleExpand(key);
|
|
1686
1686
|
},
|
|
1687
|
-
className:
|
|
1687
|
+
className: require_text_truncate.cn("rounded p-0.5 text-sm transition-transform", "text-text-secondary", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-ring-offset", isExpanded && "rotate-90"),
|
|
1688
1688
|
"aria-expanded": isExpanded,
|
|
1689
1689
|
"aria-label": `${isExpanded ? "Collapse" : "Expand"} row ${key}`,
|
|
1690
1690
|
children: "▶"
|
|
@@ -1694,10 +1694,10 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1694
1694
|
var _col$align2, _col$barColor;
|
|
1695
1695
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
1696
1696
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
1697
|
-
className:
|
|
1697
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TD, alignmentClass[(_col$align2 = col.align) !== null && _col$align2 !== void 0 ? _col$align2 : "left"], colIndex === 0 ? "font-medium" : ""),
|
|
1698
1698
|
role: "gridcell"
|
|
1699
1699
|
}),
|
|
1700
|
-
className:
|
|
1700
|
+
className: require_text_truncate.OPT_TABLE_ROW_ACTIVE,
|
|
1701
1701
|
onKeyDown: (event) => {
|
|
1702
1702
|
if (!onRowClick || event.target !== event.currentTarget || event.key !== "Enter" && event.key !== " ") return;
|
|
1703
1703
|
event.preventDefault();
|
|
@@ -1721,7 +1721,7 @@ function DataTable({ data, columns, keyExtractor, title = "Data Table", onRowCli
|
|
|
1721
1721
|
})
|
|
1722
1722
|
})
|
|
1723
1723
|
}),
|
|
1724
|
-
pageSize && totalPages > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1724
|
+
pageSize && totalPages > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Pagination, {
|
|
1725
1725
|
totalItems: sortedData.length,
|
|
1726
1726
|
pageSize,
|
|
1727
1727
|
currentPage: page + 1,
|
|
@@ -1751,7 +1751,7 @@ const toastStore = {
|
|
|
1751
1751
|
add(input) {
|
|
1752
1752
|
var _input$variant;
|
|
1753
1753
|
const id = `toast-${++toastCounter}`;
|
|
1754
|
-
toasts = [...toasts,
|
|
1754
|
+
toasts = [...toasts, require_text_truncate._objectSpread2({
|
|
1755
1755
|
id,
|
|
1756
1756
|
variant: (_input$variant = input.variant) !== null && _input$variant !== void 0 ? _input$variant : "info"
|
|
1757
1757
|
}, input)];
|
|
@@ -1773,7 +1773,7 @@ const toastStore = {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
};
|
|
1775
1775
|
function makeVariant(variant) {
|
|
1776
|
-
return (message, options) => toastStore.add(
|
|
1776
|
+
return (message, options) => toastStore.add(require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, options), {}, {
|
|
1777
1777
|
message,
|
|
1778
1778
|
variant
|
|
1779
1779
|
}));
|
|
@@ -1811,7 +1811,7 @@ function ToastProvider({ children, position = "top-right", defaultDuration = 5e3
|
|
|
1811
1811
|
removeToast
|
|
1812
1812
|
},
|
|
1813
1813
|
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1814
|
-
className:
|
|
1814
|
+
className: require_text_truncate.cn("gap-element fixed z-50 flex flex-col", positionStyles[position]),
|
|
1815
1815
|
role: "region",
|
|
1816
1816
|
"aria-label": "Notifications",
|
|
1817
1817
|
"data-opt-id": "M0KTS",
|
|
@@ -1884,7 +1884,7 @@ function NotificationToast({ toast, onDismiss, defaultDuration = 5e3 }) {
|
|
|
1884
1884
|
},
|
|
1885
1885
|
"data-opt-id": "26YVM",
|
|
1886
1886
|
"data-opt-slug": "notification-toast.NotificationToast",
|
|
1887
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
1887
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.Alert, {
|
|
1888
1888
|
variant: toast.variant,
|
|
1889
1889
|
title: toast.title,
|
|
1890
1890
|
dismissible: true,
|
|
@@ -1903,7 +1903,7 @@ function NotificationToast({ toast, onDismiss, defaultDuration = 5e3 }) {
|
|
|
1903
1903
|
}
|
|
1904
1904
|
//#endregion
|
|
1905
1905
|
//#region src/shells/failure-list.tsx
|
|
1906
|
-
const defaultLabels$
|
|
1906
|
+
const defaultLabels$9 = {
|
|
1907
1907
|
title: "최근 실패",
|
|
1908
1908
|
emptyMessage: "실패 항목이 없습니다",
|
|
1909
1909
|
moreItems: "{count}개 더 보기",
|
|
@@ -1964,7 +1964,7 @@ function FailureItemRow({ failure, isLast, onFailureClick, renderActions, merged
|
|
|
1964
1964
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("article", {}),
|
|
1965
1965
|
role: "article",
|
|
1966
1966
|
"aria-labelledby": itemId,
|
|
1967
|
-
className:
|
|
1967
|
+
className: require_text_truncate.cn("group gap-group relative flex w-full items-start p-3", require_text_truncate.OPT_FOCUS_VISIBLE, "data-[active-item]:bg-accent-subtle", onFailureClick && "cursor-pointer", !isLast && "border-border-subtle border-b", severityBorder[failure.severity]),
|
|
1968
1968
|
onClick: () => onFailureClick === null || onFailureClick === void 0 ? void 0 : onFailureClick(failure),
|
|
1969
1969
|
onKeyDown: handleKeyDown,
|
|
1970
1970
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1972,13 +1972,13 @@ function FailureItemRow({ failure, isLast, onFailureClick, renderActions, merged
|
|
|
1972
1972
|
children: [
|
|
1973
1973
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1974
1974
|
className: "gap-element flex items-center",
|
|
1975
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1975
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Badge, {
|
|
1976
1976
|
variant: severityVariant[failure.severity],
|
|
1977
1977
|
size: "sm",
|
|
1978
1978
|
children: mergedSeverityLabels[failure.severity]
|
|
1979
1979
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1980
1980
|
id: itemId,
|
|
1981
|
-
className: `text-sm font-medium ${
|
|
1981
|
+
className: `text-sm font-medium ${require_text_truncate.OPT_TEXT_PRIMARY} truncate`,
|
|
1982
1982
|
children: failure.title
|
|
1983
1983
|
})]
|
|
1984
1984
|
}),
|
|
@@ -1988,7 +1988,7 @@ function FailureItemRow({ failure, isLast, onFailureClick, renderActions, merged
|
|
|
1988
1988
|
}),
|
|
1989
1989
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
|
|
1990
1990
|
dateTime: failure.timestamp,
|
|
1991
|
-
className: `mt-1 block text-xs ${
|
|
1991
|
+
className: `mt-1 block text-xs ${require_text_truncate.OPT_TEXT_TERTIARY}`,
|
|
1992
1992
|
children: formatRelativeTime(failure.timestamp, mergedTimeAgo, locale)
|
|
1993
1993
|
})
|
|
1994
1994
|
]
|
|
@@ -2002,20 +2002,20 @@ function FailureItemRow({ failure, isLast, onFailureClick, renderActions, merged
|
|
|
2002
2002
|
function FailureList({ failures, title, maxItems, grouped = false, onFailureClick, onShowMore, labels: customLabels, locale = "ko-KR", loading = false, renderActions, className }) {
|
|
2003
2003
|
var _customLabels$timeAgo, _customLabels$timeAgo2, _customLabels$timeAgo3, _customLabels$timeAgo4, _customLabels$timeAgo5, _customLabels$timeAgo6, _customLabels$timeAgo7, _customLabels$timeAgo8, _customLabels$severit, _customLabels$severit2, _customLabels$severit3, _customLabels$severit4, _customLabels$severit5, _customLabels$severit6, _customLabels$title, _customLabels$emptyMe, _customLabels$moreIte;
|
|
2004
2004
|
const mergedTimeAgo = {
|
|
2005
|
-
justNow: (_customLabels$timeAgo = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo2 = customLabels.timeAgo) === null || _customLabels$timeAgo2 === void 0 ? void 0 : _customLabels$timeAgo2.justNow) !== null && _customLabels$timeAgo !== void 0 ? _customLabels$timeAgo : defaultLabels$
|
|
2006
|
-
minutesAgo: (_customLabels$timeAgo3 = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo4 = customLabels.timeAgo) === null || _customLabels$timeAgo4 === void 0 ? void 0 : _customLabels$timeAgo4.minutesAgo) !== null && _customLabels$timeAgo3 !== void 0 ? _customLabels$timeAgo3 : defaultLabels$
|
|
2007
|
-
hoursAgo: (_customLabels$timeAgo5 = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo6 = customLabels.timeAgo) === null || _customLabels$timeAgo6 === void 0 ? void 0 : _customLabels$timeAgo6.hoursAgo) !== null && _customLabels$timeAgo5 !== void 0 ? _customLabels$timeAgo5 : defaultLabels$
|
|
2008
|
-
daysAgo: (_customLabels$timeAgo7 = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo8 = customLabels.timeAgo) === null || _customLabels$timeAgo8 === void 0 ? void 0 : _customLabels$timeAgo8.daysAgo) !== null && _customLabels$timeAgo7 !== void 0 ? _customLabels$timeAgo7 : defaultLabels$
|
|
2005
|
+
justNow: (_customLabels$timeAgo = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo2 = customLabels.timeAgo) === null || _customLabels$timeAgo2 === void 0 ? void 0 : _customLabels$timeAgo2.justNow) !== null && _customLabels$timeAgo !== void 0 ? _customLabels$timeAgo : defaultLabels$9.timeAgo.justNow,
|
|
2006
|
+
minutesAgo: (_customLabels$timeAgo3 = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo4 = customLabels.timeAgo) === null || _customLabels$timeAgo4 === void 0 ? void 0 : _customLabels$timeAgo4.minutesAgo) !== null && _customLabels$timeAgo3 !== void 0 ? _customLabels$timeAgo3 : defaultLabels$9.timeAgo.minutesAgo,
|
|
2007
|
+
hoursAgo: (_customLabels$timeAgo5 = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo6 = customLabels.timeAgo) === null || _customLabels$timeAgo6 === void 0 ? void 0 : _customLabels$timeAgo6.hoursAgo) !== null && _customLabels$timeAgo5 !== void 0 ? _customLabels$timeAgo5 : defaultLabels$9.timeAgo.hoursAgo,
|
|
2008
|
+
daysAgo: (_customLabels$timeAgo7 = customLabels === null || customLabels === void 0 || (_customLabels$timeAgo8 = customLabels.timeAgo) === null || _customLabels$timeAgo8 === void 0 ? void 0 : _customLabels$timeAgo8.daysAgo) !== null && _customLabels$timeAgo7 !== void 0 ? _customLabels$timeAgo7 : defaultLabels$9.timeAgo.daysAgo
|
|
2009
2009
|
};
|
|
2010
2010
|
const mergedSeverityLabels = {
|
|
2011
|
-
critical: (_customLabels$severit = customLabels === null || customLabels === void 0 || (_customLabels$severit2 = customLabels.severityLabels) === null || _customLabels$severit2 === void 0 ? void 0 : _customLabels$severit2.critical) !== null && _customLabels$severit !== void 0 ? _customLabels$severit : defaultLabels$
|
|
2012
|
-
error: (_customLabels$severit3 = customLabels === null || customLabels === void 0 || (_customLabels$severit4 = customLabels.severityLabels) === null || _customLabels$severit4 === void 0 ? void 0 : _customLabels$severit4.error) !== null && _customLabels$severit3 !== void 0 ? _customLabels$severit3 : defaultLabels$
|
|
2013
|
-
warning: (_customLabels$severit5 = customLabels === null || customLabels === void 0 || (_customLabels$severit6 = customLabels.severityLabels) === null || _customLabels$severit6 === void 0 ? void 0 : _customLabels$severit6.warning) !== null && _customLabels$severit5 !== void 0 ? _customLabels$severit5 : defaultLabels$
|
|
2011
|
+
critical: (_customLabels$severit = customLabels === null || customLabels === void 0 || (_customLabels$severit2 = customLabels.severityLabels) === null || _customLabels$severit2 === void 0 ? void 0 : _customLabels$severit2.critical) !== null && _customLabels$severit !== void 0 ? _customLabels$severit : defaultLabels$9.severityLabels.critical,
|
|
2012
|
+
error: (_customLabels$severit3 = customLabels === null || customLabels === void 0 || (_customLabels$severit4 = customLabels.severityLabels) === null || _customLabels$severit4 === void 0 ? void 0 : _customLabels$severit4.error) !== null && _customLabels$severit3 !== void 0 ? _customLabels$severit3 : defaultLabels$9.severityLabels.error,
|
|
2013
|
+
warning: (_customLabels$severit5 = customLabels === null || customLabels === void 0 || (_customLabels$severit6 = customLabels.severityLabels) === null || _customLabels$severit6 === void 0 ? void 0 : _customLabels$severit6.warning) !== null && _customLabels$severit5 !== void 0 ? _customLabels$severit5 : defaultLabels$9.severityLabels.warning
|
|
2014
2014
|
};
|
|
2015
2015
|
const labels = {
|
|
2016
|
-
title: (_customLabels$title = customLabels === null || customLabels === void 0 ? void 0 : customLabels.title) !== null && _customLabels$title !== void 0 ? _customLabels$title : defaultLabels$
|
|
2017
|
-
emptyMessage: (_customLabels$emptyMe = customLabels === null || customLabels === void 0 ? void 0 : customLabels.emptyMessage) !== null && _customLabels$emptyMe !== void 0 ? _customLabels$emptyMe : defaultLabels$
|
|
2018
|
-
moreItems: (_customLabels$moreIte = customLabels === null || customLabels === void 0 ? void 0 : customLabels.moreItems) !== null && _customLabels$moreIte !== void 0 ? _customLabels$moreIte : defaultLabels$
|
|
2016
|
+
title: (_customLabels$title = customLabels === null || customLabels === void 0 ? void 0 : customLabels.title) !== null && _customLabels$title !== void 0 ? _customLabels$title : defaultLabels$9.title,
|
|
2017
|
+
emptyMessage: (_customLabels$emptyMe = customLabels === null || customLabels === void 0 ? void 0 : customLabels.emptyMessage) !== null && _customLabels$emptyMe !== void 0 ? _customLabels$emptyMe : defaultLabels$9.emptyMessage,
|
|
2018
|
+
moreItems: (_customLabels$moreIte = customLabels === null || customLabels === void 0 ? void 0 : customLabels.moreItems) !== null && _customLabels$moreIte !== void 0 ? _customLabels$moreIte : defaultLabels$9.moreItems
|
|
2019
2019
|
};
|
|
2020
2020
|
const displayTitle = title !== null && title !== void 0 ? title : labels.title;
|
|
2021
2021
|
const allItems = maxItems ? failures.slice(0, maxItems) : failures;
|
|
@@ -2038,7 +2038,7 @@ function FailureList({ failures, title, maxItems, grouped = false, onFailureClic
|
|
|
2038
2038
|
children: displayTitle
|
|
2039
2039
|
}), failures.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2040
2040
|
role: "status",
|
|
2041
|
-
className: `py-8 text-center text-sm ${
|
|
2041
|
+
className: `py-8 text-center text-sm ${require_text_truncate.OPT_TEXT_SECONDARY}`,
|
|
2042
2042
|
children: labels.emptyMessage
|
|
2043
2043
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeProvider, {
|
|
2044
2044
|
focusLoop: true,
|
|
@@ -2047,7 +2047,7 @@ function FailureList({ failures, title, maxItems, grouped = false, onFailureClic
|
|
|
2047
2047
|
role: "feed",
|
|
2048
2048
|
"aria-label": displayTitle,
|
|
2049
2049
|
"aria-busy": loading,
|
|
2050
|
-
className: `rounded-lg ${
|
|
2050
|
+
className: `rounded-lg ${require_text_truncate.OPT_BORDER} bg-surface`,
|
|
2051
2051
|
children: grouped ? renderGrouped(allItems, remainingCount, rowProps, labels, onShowMore) : renderFlat(allItems, remainingCount, rowProps, labels, onShowMore)
|
|
2052
2052
|
})
|
|
2053
2053
|
})]
|
|
@@ -2055,7 +2055,7 @@ function FailureList({ failures, title, maxItems, grouped = false, onFailureClic
|
|
|
2055
2055
|
});
|
|
2056
2056
|
}
|
|
2057
2057
|
function renderFlat(items, remainingCount, rowProps, labels, onShowMore) {
|
|
2058
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [items.map((failure, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailureItemRow,
|
|
2058
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [items.map((failure, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailureItemRow, require_text_truncate._objectSpread2({
|
|
2059
2059
|
failure,
|
|
2060
2060
|
isLast: index === items.length - 1 && remainingCount === 0
|
|
2061
2061
|
}, rowProps), failure.id)), remainingCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
@@ -2075,9 +2075,9 @@ function renderGrouped(items, remainingCount, rowProps, labels, onShowMore) {
|
|
|
2075
2075
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [groupEntries.map(([groupName, groupItems], groupIndex) => {
|
|
2076
2076
|
const isLastGroup = groupIndex === groupEntries.length - 1 && remainingCount === 0;
|
|
2077
2077
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [groupName && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2078
|
-
className:
|
|
2078
|
+
className: require_text_truncate.cn(`px-3 py-2 text-xs font-semibold text-text-tertiary tracking-wider uppercase`, groupIndex > 0 && "border-border-subtle border-t"),
|
|
2079
2079
|
children: groupName
|
|
2080
|
-
}), groupItems.map((failure, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailureItemRow,
|
|
2080
|
+
}), groupItems.map((failure, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FailureItemRow, require_text_truncate._objectSpread2({
|
|
2081
2081
|
failure,
|
|
2082
2082
|
isLast: isLastGroup && index === groupItems.length - 1
|
|
2083
2083
|
}, rowProps), failure.id))] }, groupName || "__ungrouped__");
|
|
@@ -2091,7 +2091,7 @@ function renderGrouped(items, remainingCount, rowProps, labels, onShowMore) {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
//#endregion
|
|
2093
2093
|
//#region src/shells/key-value-editor.tsx
|
|
2094
|
-
const defaultLabels$
|
|
2094
|
+
const defaultLabels$8 = {
|
|
2095
2095
|
keyPlaceholder: "키",
|
|
2096
2096
|
valuePlaceholder: "값",
|
|
2097
2097
|
addButton: "추가",
|
|
@@ -2105,7 +2105,7 @@ function generateId() {
|
|
|
2105
2105
|
}
|
|
2106
2106
|
/** Renders the key value editor component. */
|
|
2107
2107
|
function KeyValueEditor({ value: controlledValue, defaultValue, onChange, showSecretToggle = false, maxEntries, readOnly = false, labels: customLabels, renderActions, validateKey, className }) {
|
|
2108
|
-
const labels =
|
|
2108
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$8), customLabels);
|
|
2109
2109
|
const [internalEntries, setInternalEntries] = (0, react.useState)(() => defaultValue !== null && defaultValue !== void 0 ? defaultValue : []);
|
|
2110
2110
|
const entries = controlledValue !== null && controlledValue !== void 0 ? controlledValue : internalEntries;
|
|
2111
2111
|
const keyInputRef = (0, react.useRef)(null);
|
|
@@ -2135,14 +2135,14 @@ function KeyValueEditor({ value: controlledValue, defaultValue, onChange, showSe
|
|
|
2135
2135
|
updateEntries(entries.filter((e) => e.id !== id));
|
|
2136
2136
|
}, [entries, updateEntries]);
|
|
2137
2137
|
const updateEntry = (0, react.useCallback)((id, field, val) => {
|
|
2138
|
-
updateEntries(entries.map((e) => e.id === id ?
|
|
2138
|
+
updateEntries(entries.map((e) => e.id === id ? require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, e), {}, { [field]: val }) : e));
|
|
2139
2139
|
}, [entries, updateEntries]);
|
|
2140
2140
|
const toggleSecret = (0, react.useCallback)((id) => {
|
|
2141
|
-
updateEntries(entries.map((e) => e.id === id ?
|
|
2141
|
+
updateEntries(entries.map((e) => e.id === id ? require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, e), {}, { isSecret: !e.isSecret }) : e));
|
|
2142
2142
|
}, [entries, updateEntries]);
|
|
2143
2143
|
const canAdd = !readOnly && (!maxEntries || entries.length < maxEntries);
|
|
2144
2144
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2145
|
-
className:
|
|
2145
|
+
className: require_text_truncate.cn("gap-group flex flex-col", className),
|
|
2146
2146
|
"data-opt-id": "NCBWA",
|
|
2147
2147
|
"data-opt-slug": "key-value-editor.KeyValueEditor",
|
|
2148
2148
|
children: [entries.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -2155,7 +2155,7 @@ function KeyValueEditor({ value: controlledValue, defaultValue, onChange, showSe
|
|
|
2155
2155
|
const keyError = validateKey === null || validateKey === void 0 ? void 0 : validateKey(entry.key, entries);
|
|
2156
2156
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2157
2157
|
"data-kv-id": entry.id,
|
|
2158
|
-
className:
|
|
2158
|
+
className: require_text_truncate.cn("gap-element flex items-start", "border-border rounded-lg border p-3", "bg-surface"),
|
|
2159
2159
|
children: [
|
|
2160
2160
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2161
2161
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
@@ -2168,7 +2168,7 @@ function KeyValueEditor({ value: controlledValue, defaultValue, onChange, showSe
|
|
|
2168
2168
|
placeholder: labels.keyPlaceholder,
|
|
2169
2169
|
readOnly,
|
|
2170
2170
|
"aria-label": `${labels.keyPlaceholder} ${index + 1}`,
|
|
2171
|
-
className:
|
|
2171
|
+
className: require_text_truncate.cn("border-border bg-bg-subtle text-text-primary placeholder:text-text-tertiary w-full rounded-md border px-3 py-1.5 font-mono text-sm", "focus:border-accent focus-visible:ring-ring focus-visible:ring-offset-ring-offset focus-visible:ring-2 focus-visible:ring-offset-1", readOnly && "cursor-default opacity-70", keyError && "border-error")
|
|
2172
2172
|
}), keyError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2173
2173
|
className: "text-error text-xs",
|
|
2174
2174
|
children: keyError
|
|
@@ -2187,7 +2187,7 @@ function KeyValueEditor({ value: controlledValue, defaultValue, onChange, showSe
|
|
|
2187
2187
|
placeholder: labels.valuePlaceholder,
|
|
2188
2188
|
readOnly,
|
|
2189
2189
|
"aria-label": `${labels.valuePlaceholder} ${index + 1}`,
|
|
2190
|
-
className:
|
|
2190
|
+
className: require_text_truncate.cn("border-border bg-bg-subtle text-text-primary placeholder:text-text-tertiary w-full rounded-md border px-3 py-1.5 font-mono text-sm", "focus:border-accent focus-visible:ring-ring focus-visible:ring-offset-ring-offset focus-visible:ring-2 focus-visible:ring-offset-1", readOnly && "cursor-default opacity-70")
|
|
2191
2191
|
})
|
|
2192
2192
|
}),
|
|
2193
2193
|
showSecretToggle && !readOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -2252,7 +2252,7 @@ function KeyValueEditor({ value: controlledValue, defaultValue, onChange, showSe
|
|
|
2252
2252
|
}), canAdd && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2253
2253
|
type: "button",
|
|
2254
2254
|
onClick: addEntry,
|
|
2255
|
-
className:
|
|
2255
|
+
className: require_text_truncate.cn("border-border text-text-secondary rounded-lg border border-dashed px-4 py-2 text-sm transition-colors", "hover:border-accent hover:text-accent"),
|
|
2256
2256
|
children: labels.addButton
|
|
2257
2257
|
})]
|
|
2258
2258
|
});
|
|
@@ -2276,11 +2276,11 @@ function WorkflowCanvas({ steps, connections = [], rows = 9, cols = 9, cellSize
|
|
|
2276
2276
|
const renderDefaultStep = react.useCallback((step, selected) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2277
2277
|
type: "button",
|
|
2278
2278
|
onClick: () => onSelectStep === null || onSelectStep === void 0 ? void 0 : onSelectStep(step),
|
|
2279
|
-
className:
|
|
2279
|
+
className: require_text_truncate.cn("group absolute flex h-full w-full flex-col justify-between rounded-lg border p-2 text-left transition-colors", selected ? "border-accent bg-accent-subtle" : "border-border bg-surface hover:bg-bg-subtle"),
|
|
2280
2280
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2281
2281
|
className: "text-text-primary truncate text-xs font-medium",
|
|
2282
2282
|
children: step.title
|
|
2283
|
-
}), step.status && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2283
|
+
}), step.status && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Badge, {
|
|
2284
2284
|
variant: statusVariant[step.status],
|
|
2285
2285
|
size: "sm",
|
|
2286
2286
|
className: "w-fit",
|
|
@@ -2314,7 +2314,7 @@ function WorkflowCanvas({ steps, connections = [], rows = 9, cols = 9, cellSize
|
|
|
2314
2314
|
cols
|
|
2315
2315
|
]);
|
|
2316
2316
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2317
|
-
className:
|
|
2317
|
+
className: require_text_truncate.cn("gap-group flex flex-col", className),
|
|
2318
2318
|
"data-opt-id": "4TX11",
|
|
2319
2319
|
"data-opt-slug": "workflow-canvas.WorkflowCanvas",
|
|
2320
2320
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
@@ -2401,6 +2401,555 @@ function WorkflowCanvas({ steps, connections = [], rows = 9, cols = 9, cellSize
|
|
|
2401
2401
|
}
|
|
2402
2402
|
WorkflowCanvas.displayName = "WorkflowCanvas";
|
|
2403
2403
|
//#endregion
|
|
2404
|
+
//#region src/shells/event-timeline.tsx
|
|
2405
|
+
const defaultLabels$7 = {
|
|
2406
|
+
emptyTitle: "No events yet",
|
|
2407
|
+
emptyDescription: "Events appear here as soon as they arrive.",
|
|
2408
|
+
expand: "Show properties",
|
|
2409
|
+
collapse: "Hide properties",
|
|
2410
|
+
loadMore: "Load more",
|
|
2411
|
+
gap: (duration) => `+${duration}`,
|
|
2412
|
+
properties: "Event properties",
|
|
2413
|
+
openGroup: (title) => `Open ${title}`
|
|
2414
|
+
};
|
|
2415
|
+
/**
|
|
2416
|
+
* A line of text and the time it happened have to read as one row. Past about
|
|
2417
|
+
* this width the eye stops connecting them, so the rail is capped rather than
|
|
2418
|
+
* stretched to whatever the page allows. Override with `className` where a
|
|
2419
|
+
* layout genuinely needs the full width.
|
|
2420
|
+
*/
|
|
2421
|
+
const TIMELINE_WIDTH = "max-w-5xl";
|
|
2422
|
+
const toneDot = {
|
|
2423
|
+
default: "bg-text-tertiary",
|
|
2424
|
+
accent: "bg-accent",
|
|
2425
|
+
success: "bg-success",
|
|
2426
|
+
warning: "bg-warning",
|
|
2427
|
+
danger: "bg-danger"
|
|
2428
|
+
};
|
|
2429
|
+
function toMillis(timestamp) {
|
|
2430
|
+
const parsed = Date.parse(timestamp);
|
|
2431
|
+
return Number.isNaN(parsed) ? 0 : parsed;
|
|
2432
|
+
}
|
|
2433
|
+
function stringifyValue(value) {
|
|
2434
|
+
if (value === null || value === void 0) return "—";
|
|
2435
|
+
if (typeof value === "string") return value;
|
|
2436
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
2437
|
+
return JSON.stringify(value);
|
|
2438
|
+
}
|
|
2439
|
+
function PropertyTable({ properties, ariaLabel }) {
|
|
2440
|
+
const entries = Object.entries(properties);
|
|
2441
|
+
if (entries.length === 0) return null;
|
|
2442
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", {
|
|
2443
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_BORDER, "gap-element bg-bg-subtle mt-2 grid grid-cols-1 rounded-lg p-2.5 sm:grid-cols-2"),
|
|
2444
|
+
"aria-label": ariaLabel,
|
|
2445
|
+
children: entries.map(([key, value]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2446
|
+
className: "flex min-w-0 flex-col",
|
|
2447
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
2448
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "truncate text-xs"),
|
|
2449
|
+
children: key
|
|
2450
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
2451
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_PRIMARY, "truncate text-xs"),
|
|
2452
|
+
children: stringifyValue(value)
|
|
2453
|
+
})]
|
|
2454
|
+
}, key))
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
function TimelineRow({ item, gapLabel, labels, onItemSelect, isLast }) {
|
|
2458
|
+
var _item$tone, _item$content, _item$properties;
|
|
2459
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
2460
|
+
const expandable = Boolean(item.content || item.properties);
|
|
2461
|
+
const toggle = (0, react.useCallback)(() => setOpen((value) => !value), []);
|
|
2462
|
+
const headline = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2463
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_PRIMARY, "truncate text-sm font-medium"),
|
|
2464
|
+
children: item.name
|
|
2465
|
+
});
|
|
2466
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2467
|
+
className: "relative flex gap-3 pb-4 last:pb-0",
|
|
2468
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2469
|
+
className: "flex shrink-0 flex-col items-center",
|
|
2470
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2471
|
+
className: require_text_truncate.cn("mt-1.5 size-2 shrink-0 rounded-full", toneDot[(_item$tone = item.tone) !== null && _item$tone !== void 0 ? _item$tone : "default"]),
|
|
2472
|
+
"aria-hidden": "true"
|
|
2473
|
+
}), !isLast && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2474
|
+
className: "bg-border mt-1 w-px grow",
|
|
2475
|
+
"aria-hidden": "true"
|
|
2476
|
+
})]
|
|
2477
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2478
|
+
className: "flex min-w-0 grow flex-col",
|
|
2479
|
+
children: [
|
|
2480
|
+
gapLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2481
|
+
className: require_text_truncate.cn("text-text-tertiary", "mb-1 text-xs tabular-nums"),
|
|
2482
|
+
children: labels.gap(gapLabel)
|
|
2483
|
+
}),
|
|
2484
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2485
|
+
className: "flex min-w-0 items-baseline gap-2",
|
|
2486
|
+
children: [
|
|
2487
|
+
item.icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2488
|
+
className: "text-text-tertiary",
|
|
2489
|
+
"aria-hidden": "true",
|
|
2490
|
+
children: item.icon
|
|
2491
|
+
}),
|
|
2492
|
+
onItemSelect ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2493
|
+
type: "button",
|
|
2494
|
+
onClick: () => onItemSelect(item),
|
|
2495
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_FOCUS_VISIBLE, "hover:text-accent min-w-0 truncate rounded text-left"),
|
|
2496
|
+
children: headline
|
|
2497
|
+
}) : headline,
|
|
2498
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
|
|
2499
|
+
dateTime: item.timestamp,
|
|
2500
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "ml-auto shrink-0 text-xs tabular-nums"),
|
|
2501
|
+
children: require_text_truncate.formatOptTime(item.timestamp)
|
|
2502
|
+
})
|
|
2503
|
+
]
|
|
2504
|
+
}),
|
|
2505
|
+
item.detail && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2506
|
+
className: require_text_truncate.cn("text-text-secondary", "truncate text-xs"),
|
|
2507
|
+
children: item.detail
|
|
2508
|
+
}),
|
|
2509
|
+
expandable && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2510
|
+
type: "button",
|
|
2511
|
+
onClick: toggle,
|
|
2512
|
+
"aria-expanded": open,
|
|
2513
|
+
className: require_text_truncate.cn("outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-ring-offset", "text-text-tertiary", "hover:text-text-primary mt-1 flex w-fit items-center gap-1 rounded text-xs"),
|
|
2514
|
+
children: [open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
2515
|
+
className: "size-3",
|
|
2516
|
+
"aria-hidden": "true"
|
|
2517
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, {
|
|
2518
|
+
className: "size-3",
|
|
2519
|
+
"aria-hidden": "true"
|
|
2520
|
+
}), open ? labels.collapse : labels.expand]
|
|
2521
|
+
}), open && ((_item$content = item.content) !== null && _item$content !== void 0 ? _item$content : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PropertyTable, {
|
|
2522
|
+
properties: (_item$properties = item.properties) !== null && _item$properties !== void 0 ? _item$properties : {},
|
|
2523
|
+
ariaLabel: labels.properties
|
|
2524
|
+
}))] })
|
|
2525
|
+
]
|
|
2526
|
+
})]
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
/** Builds the gap label for each row, given the reading order. */
|
|
2530
|
+
function useGapLabels(items, showGaps, order, minGapMs, locale) {
|
|
2531
|
+
return (0, react.useMemo)(() => {
|
|
2532
|
+
if (!showGaps) return items.map(() => null);
|
|
2533
|
+
return items.map((item, index) => {
|
|
2534
|
+
const neighbour = order === "desc" ? items[index + 1] : items[index - 1];
|
|
2535
|
+
if (!neighbour) return null;
|
|
2536
|
+
const delta = Math.abs(toMillis(item.timestamp) - toMillis(neighbour.timestamp));
|
|
2537
|
+
if (delta < minGapMs) return null;
|
|
2538
|
+
return (0, _reopt_ai_opt_charts.formatDuration)(delta, locale);
|
|
2539
|
+
});
|
|
2540
|
+
}, [
|
|
2541
|
+
items,
|
|
2542
|
+
showGaps,
|
|
2543
|
+
order,
|
|
2544
|
+
minGapMs,
|
|
2545
|
+
locale
|
|
2546
|
+
]);
|
|
2547
|
+
}
|
|
2548
|
+
function TimelineList({ items, showGaps, order, minGapMs, locale, labels, onItemSelect }) {
|
|
2549
|
+
const gaps = useGapLabels(items, showGaps, order, minGapMs, locale);
|
|
2550
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
|
|
2551
|
+
className: "flex flex-col",
|
|
2552
|
+
children: items.map((item, index) => {
|
|
2553
|
+
var _gaps$index;
|
|
2554
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TimelineRow, {
|
|
2555
|
+
item,
|
|
2556
|
+
gapLabel: (_gaps$index = gaps[index]) !== null && _gaps$index !== void 0 ? _gaps$index : null,
|
|
2557
|
+
labels,
|
|
2558
|
+
onItemSelect,
|
|
2559
|
+
isLast: index === items.length - 1
|
|
2560
|
+
}, item.id);
|
|
2561
|
+
})
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
function GroupBlock({ group, showGaps, order, minGapMs, locale, labels, onItemSelect }) {
|
|
2565
|
+
var _group$defaultOpen;
|
|
2566
|
+
const [open, setOpen] = (0, react.useState)((_group$defaultOpen = group.defaultOpen) !== null && _group$defaultOpen !== void 0 ? _group$defaultOpen : true);
|
|
2567
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2568
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_BORDER, "rounded-xl"),
|
|
2569
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2570
|
+
className: "flex items-center gap-2 px-3 py-2",
|
|
2571
|
+
children: [
|
|
2572
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2573
|
+
type: "button",
|
|
2574
|
+
onClick: () => setOpen((value) => !value),
|
|
2575
|
+
"aria-expanded": open,
|
|
2576
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_FOCUS_VISIBLE, "flex min-w-0 grow items-center gap-2 rounded text-left"),
|
|
2577
|
+
children: [
|
|
2578
|
+
open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, {
|
|
2579
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "size-4 shrink-0"),
|
|
2580
|
+
"aria-hidden": "true"
|
|
2581
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRight, {
|
|
2582
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "size-4 shrink-0"),
|
|
2583
|
+
"aria-hidden": "true"
|
|
2584
|
+
}),
|
|
2585
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2586
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_PRIMARY, "truncate text-sm font-medium"),
|
|
2587
|
+
children: group.title
|
|
2588
|
+
}),
|
|
2589
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Badge, {
|
|
2590
|
+
size: "sm",
|
|
2591
|
+
variant: "default",
|
|
2592
|
+
className: "shrink-0",
|
|
2593
|
+
children: group.items.length
|
|
2594
|
+
})
|
|
2595
|
+
]
|
|
2596
|
+
}),
|
|
2597
|
+
group.meta && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2598
|
+
className: require_text_truncate.cn("text-text-tertiary", "shrink-0 text-xs"),
|
|
2599
|
+
children: group.meta
|
|
2600
|
+
}),
|
|
2601
|
+
group.href && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
2602
|
+
href: group.href,
|
|
2603
|
+
className: require_text_truncate.cn("outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-ring-offset", "text-accent shrink-0 rounded text-xs"),
|
|
2604
|
+
children: labels.openGroup(typeof group.title === "string" ? group.title : group.id)
|
|
2605
|
+
})
|
|
2606
|
+
]
|
|
2607
|
+
}), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2608
|
+
className: "border-border-subtle border-t px-3 py-3",
|
|
2609
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TimelineList, {
|
|
2610
|
+
items: group.items,
|
|
2611
|
+
showGaps,
|
|
2612
|
+
order,
|
|
2613
|
+
minGapMs,
|
|
2614
|
+
locale,
|
|
2615
|
+
labels,
|
|
2616
|
+
onItemSelect
|
|
2617
|
+
})
|
|
2618
|
+
})]
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
/**
|
|
2622
|
+
* EventTimeline — a sequence of events, read as a sequence.
|
|
2623
|
+
*
|
|
2624
|
+
* A table of events answers "what happened" and hides "how it went": the rows
|
|
2625
|
+
* are evenly spaced no matter whether they were two seconds or two hours
|
|
2626
|
+
* apart, and the payload that would explain a row lives in a column nobody
|
|
2627
|
+
* widened. This renders the same data as an ordered rail, labels the elapsed
|
|
2628
|
+
* time between adjacent events, and opens each payload in place. Grouping by
|
|
2629
|
+
* session restores the boundary that makes a history legible.
|
|
2630
|
+
*
|
|
2631
|
+
* @example
|
|
2632
|
+
* ```tsx
|
|
2633
|
+
* <EventTimeline
|
|
2634
|
+
* groups={sessions.map((session) => ({
|
|
2635
|
+
* id: session.id,
|
|
2636
|
+
* title: session.entryPath,
|
|
2637
|
+
* meta: `${session.duration} · ${session.events} events`,
|
|
2638
|
+
* items: session.events,
|
|
2639
|
+
* }))}
|
|
2640
|
+
* showGaps
|
|
2641
|
+
* />
|
|
2642
|
+
* ```
|
|
2643
|
+
*/
|
|
2644
|
+
function EventTimeline({ items, groups, showGaps = true, order = "desc", minGapMs = 1e3, loading = false, hasMore = false, onLoadMore, onItemSelect, locale = require_text_truncate.OPT_UI_DEFAULT_LOCALE, labels: customLabels, className }) {
|
|
2645
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$7), customLabels);
|
|
2646
|
+
const flatItems = items !== null && items !== void 0 ? items : [];
|
|
2647
|
+
const hasContent = groups ? groups.length > 0 : flatItems.length > 0;
|
|
2648
|
+
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2649
|
+
className: require_text_truncate.cn(TIMELINE_WIDTH, "flex flex-col gap-3", className),
|
|
2650
|
+
"data-opt-id": "H6S6T",
|
|
2651
|
+
"data-opt-slug": "event-timeline.EventTimeline",
|
|
2652
|
+
children: Array.from({ length: 5 }).map((_, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2653
|
+
className: "flex gap-3",
|
|
2654
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Skeleton, { className: "mt-1.5 size-2 rounded-full" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2655
|
+
className: "flex grow flex-col gap-1.5",
|
|
2656
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Skeleton, { className: "h-4 w-40" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Skeleton, { className: "h-3 w-64" })]
|
|
2657
|
+
})]
|
|
2658
|
+
}, index))
|
|
2659
|
+
});
|
|
2660
|
+
if (!hasContent) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2661
|
+
className: require_text_truncate.cn(TIMELINE_WIDTH, className),
|
|
2662
|
+
"data-opt-id": "H6S6T",
|
|
2663
|
+
"data-opt-slug": "event-timeline.EventTimeline",
|
|
2664
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.EmptyState, {
|
|
2665
|
+
title: labels.emptyTitle,
|
|
2666
|
+
description: labels.emptyDescription,
|
|
2667
|
+
tone: "subdued",
|
|
2668
|
+
hasBorder: true
|
|
2669
|
+
})
|
|
2670
|
+
});
|
|
2671
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2672
|
+
className: require_text_truncate.cn(TIMELINE_WIDTH, "flex flex-col gap-3", className),
|
|
2673
|
+
"data-opt-id": "H6S6T",
|
|
2674
|
+
"data-opt-slug": "event-timeline.EventTimeline",
|
|
2675
|
+
children: [groups ? groups.map((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupBlock, {
|
|
2676
|
+
group,
|
|
2677
|
+
showGaps,
|
|
2678
|
+
order,
|
|
2679
|
+
minGapMs,
|
|
2680
|
+
locale,
|
|
2681
|
+
labels,
|
|
2682
|
+
onItemSelect
|
|
2683
|
+
}, group.id)) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TimelineList, {
|
|
2684
|
+
items: flatItems,
|
|
2685
|
+
showGaps,
|
|
2686
|
+
order,
|
|
2687
|
+
minGapMs,
|
|
2688
|
+
locale,
|
|
2689
|
+
labels,
|
|
2690
|
+
onItemSelect
|
|
2691
|
+
}), hasMore && onLoadMore && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2692
|
+
className: "flex justify-center pt-1",
|
|
2693
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Button, {
|
|
2694
|
+
variant: "secondary",
|
|
2695
|
+
size: "sm",
|
|
2696
|
+
onClick: onLoadMore,
|
|
2697
|
+
children: labels.loadMore
|
|
2698
|
+
})
|
|
2699
|
+
})]
|
|
2700
|
+
});
|
|
2701
|
+
}
|
|
2702
|
+
EventTimeline.displayName = "EventTimeline";
|
|
2703
|
+
//#endregion
|
|
2704
|
+
//#region src/shells/score-breakdown.tsx
|
|
2705
|
+
const defaultLabels$6 = {
|
|
2706
|
+
title: "Score",
|
|
2707
|
+
outOf: (max) => `out of ${max}`,
|
|
2708
|
+
weight: (percent) => `${percent} of total`,
|
|
2709
|
+
empty: "Not enough activity to score."
|
|
2710
|
+
};
|
|
2711
|
+
const toneText = {
|
|
2712
|
+
default: "text-text-primary",
|
|
2713
|
+
success: "text-success-fg",
|
|
2714
|
+
warning: "text-warning-fg",
|
|
2715
|
+
error: "text-danger-fg"
|
|
2716
|
+
};
|
|
2717
|
+
const toneMeter = {
|
|
2718
|
+
default: "default",
|
|
2719
|
+
success: "success",
|
|
2720
|
+
warning: "warning",
|
|
2721
|
+
error: "error"
|
|
2722
|
+
};
|
|
2723
|
+
/** Picks the band a score falls into — the highest `min` at or below it. */
|
|
2724
|
+
function resolveBand(score, bands) {
|
|
2725
|
+
return bands.filter((band) => score >= band.min).sort((left, right) => right.min - left.min)[0];
|
|
2726
|
+
}
|
|
2727
|
+
/**
|
|
2728
|
+
* ScoreBreakdown — a composite score you can argue with.
|
|
2729
|
+
*
|
|
2730
|
+
* Engagement, health and risk scores all collapse several signals into one
|
|
2731
|
+
* number, and the number alone tells nobody what to do about it. Showing the
|
|
2732
|
+
* axes and their weights beside the headline turns "43" into "recent, but
|
|
2733
|
+
* shallow", which is a finding rather than a verdict.
|
|
2734
|
+
*/
|
|
2735
|
+
function ScoreBreakdown({ score, max = 100, axes, bands = [], formula, loading = false, labels: customLabels, className }) {
|
|
2736
|
+
var _band$tone;
|
|
2737
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$6), customLabels);
|
|
2738
|
+
const band = resolveBand(score, bands);
|
|
2739
|
+
const tone = (_band$tone = band === null || band === void 0 ? void 0 : band.tone) !== null && _band$tone !== void 0 ? _band$tone : "default";
|
|
2740
|
+
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2741
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_BORDER, "flex flex-col gap-3 rounded-xl p-4", className),
|
|
2742
|
+
"data-opt-id": "DYZSG",
|
|
2743
|
+
"data-opt-slug": "score-breakdown.ScoreBreakdown",
|
|
2744
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Skeleton, { className: "h-9 w-24" }), Array.from({ length: 4 }).map((_, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Skeleton, { className: "h-6 w-full" }, index))]
|
|
2745
|
+
});
|
|
2746
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2747
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_BORDER, "flex flex-col gap-4 rounded-xl p-4", className),
|
|
2748
|
+
"data-opt-id": "DYZSG",
|
|
2749
|
+
"data-opt-slug": "score-breakdown.ScoreBreakdown",
|
|
2750
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2751
|
+
className: "flex flex-col gap-1",
|
|
2752
|
+
children: [
|
|
2753
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2754
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_SECONDARY, "text-sm"),
|
|
2755
|
+
children: labels.title
|
|
2756
|
+
}),
|
|
2757
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2758
|
+
className: "flex items-baseline gap-2",
|
|
2759
|
+
children: [
|
|
2760
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2761
|
+
className: require_text_truncate.cn("text-3xl font-bold tabular-nums", toneText[tone]),
|
|
2762
|
+
children: score
|
|
2763
|
+
}),
|
|
2764
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2765
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "text-xs"),
|
|
2766
|
+
children: labels.outOf(max)
|
|
2767
|
+
}),
|
|
2768
|
+
band && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2769
|
+
className: require_text_truncate.cn("ml-1 text-sm font-medium", toneText[tone]),
|
|
2770
|
+
children: band.label
|
|
2771
|
+
})
|
|
2772
|
+
]
|
|
2773
|
+
}),
|
|
2774
|
+
formula && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2775
|
+
className: require_text_truncate.cn("text-text-tertiary", "text-xs"),
|
|
2776
|
+
children: formula
|
|
2777
|
+
})
|
|
2778
|
+
]
|
|
2779
|
+
}), axes.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2780
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_SECONDARY, "text-sm"),
|
|
2781
|
+
children: labels.empty
|
|
2782
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", {
|
|
2783
|
+
className: "flex flex-col gap-3",
|
|
2784
|
+
children: axes.map((axis) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2785
|
+
className: "flex flex-col gap-1",
|
|
2786
|
+
children: [
|
|
2787
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2788
|
+
className: "flex items-baseline justify-between gap-2",
|
|
2789
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dt", {
|
|
2790
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_PRIMARY, "text-sm"),
|
|
2791
|
+
title: axis.hint,
|
|
2792
|
+
children: [axis.label, axis.weight !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2793
|
+
className: require_text_truncate.cn("text-text-tertiary", "ml-1.5 text-xs"),
|
|
2794
|
+
children: labels.weight(`${Math.round(axis.weight * 100)}%`)
|
|
2795
|
+
})]
|
|
2796
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
2797
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_SECONDARY, "text-sm font-medium tabular-nums"),
|
|
2798
|
+
children: Math.round(axis.value)
|
|
2799
|
+
})]
|
|
2800
|
+
}),
|
|
2801
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Meter, {
|
|
2802
|
+
value: axis.value,
|
|
2803
|
+
max,
|
|
2804
|
+
size: "sm",
|
|
2805
|
+
variant: toneMeter[tone],
|
|
2806
|
+
"aria-label": axis.label
|
|
2807
|
+
}),
|
|
2808
|
+
axis.hint && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2809
|
+
className: require_text_truncate.cn("text-text-tertiary", "text-xs"),
|
|
2810
|
+
children: axis.hint
|
|
2811
|
+
})
|
|
2812
|
+
]
|
|
2813
|
+
}, axis.id))
|
|
2814
|
+
})]
|
|
2815
|
+
});
|
|
2816
|
+
}
|
|
2817
|
+
ScoreBreakdown.displayName = "ScoreBreakdown";
|
|
2818
|
+
//#endregion
|
|
2819
|
+
//#region src/shells/flyout.tsx
|
|
2820
|
+
const defaultLabels$5 = { close: "Close panel" };
|
|
2821
|
+
const sizeClass = {
|
|
2822
|
+
sm: "sm:w-[22rem]",
|
|
2823
|
+
md: "sm:w-[30rem]",
|
|
2824
|
+
lg: "sm:w-[42rem]"
|
|
2825
|
+
};
|
|
2826
|
+
/**
|
|
2827
|
+
* Flyout — a detail panel that does not take the page away.
|
|
2828
|
+
*
|
|
2829
|
+
* Navigating from a list to a record and back costs the reader their scroll
|
|
2830
|
+
* position, their filters and their place in the scan. A flyout keeps the list
|
|
2831
|
+
* on screen and shows the record beside it, so comparing three rows is three
|
|
2832
|
+
* clicks rather than six navigations.
|
|
2833
|
+
*
|
|
2834
|
+
* Deliberately **not** a modal: no focus trap, no `aria-modal`, no inert page.
|
|
2835
|
+
* The list behind it is still the point, and a reader who tabs out of the panel
|
|
2836
|
+
* to change a filter is doing the expected thing. Escape closes; focus returns
|
|
2837
|
+
* to whatever opened it.
|
|
2838
|
+
*
|
|
2839
|
+
* @example
|
|
2840
|
+
* ```tsx
|
|
2841
|
+
* <Flyout open={Boolean(selected)} onClose={clear} title={selected?.name}>
|
|
2842
|
+
* <DescriptionList items={fields} />
|
|
2843
|
+
* </Flyout>
|
|
2844
|
+
* ```
|
|
2845
|
+
*/
|
|
2846
|
+
function Flyout({ open, onClose, title, description, type = "overlay", side = "right", size = "md", actions, footer, scrim = false, closeOnOutsideClick = true, hideCloseButton = false, labels: customLabels, className, children }) {
|
|
2847
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$5), customLabels);
|
|
2848
|
+
const panelRef = (0, react.useRef)(null);
|
|
2849
|
+
const openerRef = (0, react.useRef)(null);
|
|
2850
|
+
(0, react.useEffect)(() => {
|
|
2851
|
+
var _panelRef$current;
|
|
2852
|
+
if (!open) return;
|
|
2853
|
+
openerRef.current = document.activeElement;
|
|
2854
|
+
(_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 || _panelRef$current.focus({ preventScroll: true });
|
|
2855
|
+
return () => {
|
|
2856
|
+
var _openerRef$current, _openerRef$current$fo;
|
|
2857
|
+
(_openerRef$current = openerRef.current) === null || _openerRef$current === void 0 || (_openerRef$current$fo = _openerRef$current.focus) === null || _openerRef$current$fo === void 0 || _openerRef$current$fo.call(_openerRef$current, { preventScroll: true });
|
|
2858
|
+
};
|
|
2859
|
+
}, [open]);
|
|
2860
|
+
(0, react.useEffect)(() => {
|
|
2861
|
+
if (!open) return;
|
|
2862
|
+
const handleKeyDown = (event) => {
|
|
2863
|
+
if (event.key === "Escape") {
|
|
2864
|
+
event.stopPropagation();
|
|
2865
|
+
onClose();
|
|
2866
|
+
}
|
|
2867
|
+
};
|
|
2868
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
2869
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
2870
|
+
}, [open, onClose]);
|
|
2871
|
+
(0, react.useEffect)(() => {
|
|
2872
|
+
if (!open || !closeOnOutsideClick || type !== "overlay") return;
|
|
2873
|
+
const handlePointerDown = (event) => {
|
|
2874
|
+
const panel = panelRef.current;
|
|
2875
|
+
if (panel && !panel.contains(event.target)) onClose();
|
|
2876
|
+
};
|
|
2877
|
+
const timer = window.setTimeout(() => {
|
|
2878
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
2879
|
+
}, 0);
|
|
2880
|
+
return () => {
|
|
2881
|
+
window.clearTimeout(timer);
|
|
2882
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
2883
|
+
};
|
|
2884
|
+
}, [
|
|
2885
|
+
open,
|
|
2886
|
+
closeOnOutsideClick,
|
|
2887
|
+
type,
|
|
2888
|
+
onClose
|
|
2889
|
+
]);
|
|
2890
|
+
const handleClose = (0, react.useCallback)(() => onClose(), [onClose]);
|
|
2891
|
+
if (!open) return null;
|
|
2892
|
+
const header = (title || actions || !hideCloseButton) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
2893
|
+
className: require_text_truncate.cn("border-border-subtle flex items-start gap-2 border-b px-4 py-3"),
|
|
2894
|
+
children: [
|
|
2895
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2896
|
+
className: "flex min-w-0 grow flex-col gap-0.5",
|
|
2897
|
+
children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
2898
|
+
className: require_text_truncate.cn("text-text-primary", "truncate text-base font-semibold"),
|
|
2899
|
+
children: title
|
|
2900
|
+
}), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2901
|
+
className: require_text_truncate.cn("text-text-secondary", "truncate text-xs"),
|
|
2902
|
+
children: description
|
|
2903
|
+
})]
|
|
2904
|
+
}),
|
|
2905
|
+
actions,
|
|
2906
|
+
!hideCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2907
|
+
type: "button",
|
|
2908
|
+
onClick: handleClose,
|
|
2909
|
+
"aria-label": labels.close,
|
|
2910
|
+
className: require_text_truncate.cn("outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-ring-offset", "text-text-tertiary", "hover:text-text-primary shrink-0 rounded p-1 transition-colors"),
|
|
2911
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
|
|
2912
|
+
className: "size-4",
|
|
2913
|
+
"aria-hidden": "true"
|
|
2914
|
+
})
|
|
2915
|
+
})
|
|
2916
|
+
]
|
|
2917
|
+
});
|
|
2918
|
+
const panel = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
|
|
2919
|
+
ref: panelRef,
|
|
2920
|
+
role: "dialog",
|
|
2921
|
+
"aria-modal": false,
|
|
2922
|
+
"aria-label": typeof title === "string" ? title : void 0,
|
|
2923
|
+
tabIndex: -1,
|
|
2924
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_FOCUS_VISIBLE, "flex min-h-0 flex-col", type === "overlay" && [
|
|
2925
|
+
"rounded-xl bg-surface-raised shadow-md",
|
|
2926
|
+
"fixed inset-y-0 z-40 w-full",
|
|
2927
|
+
sizeClass[size],
|
|
2928
|
+
side === "right" ? "right-0 border-l" : "left-0 border-r",
|
|
2929
|
+
"border-border"
|
|
2930
|
+
], type === "inline" && ["border border-border", "rounded-xl bg-surface"], className),
|
|
2931
|
+
"data-opt-id": "85XVE",
|
|
2932
|
+
"data-opt-slug": "flyout.Flyout",
|
|
2933
|
+
children: [
|
|
2934
|
+
header,
|
|
2935
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2936
|
+
className: "min-h-0 grow overflow-y-auto px-4 py-4",
|
|
2937
|
+
children
|
|
2938
|
+
}),
|
|
2939
|
+
footer && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
|
|
2940
|
+
className: "border-border-subtle border-t px-4 py-3",
|
|
2941
|
+
children: footer
|
|
2942
|
+
})
|
|
2943
|
+
]
|
|
2944
|
+
});
|
|
2945
|
+
if (type === "inline") return panel;
|
|
2946
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [scrim && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2947
|
+
className: "bg-overlay fixed inset-0 z-30",
|
|
2948
|
+
"aria-hidden": "true"
|
|
2949
|
+
}), panel] });
|
|
2950
|
+
}
|
|
2951
|
+
Flyout.displayName = "Flyout";
|
|
2952
|
+
//#endregion
|
|
2404
2953
|
//#region src/lib/use-auto-refresh.ts
|
|
2405
2954
|
/**
|
|
2406
2955
|
* A refresh timer that waits for its own work.
|
|
@@ -2529,8 +3078,8 @@ function describeRange(range, labels, options) {
|
|
|
2529
3078
|
};
|
|
2530
3079
|
}
|
|
2531
3080
|
const dateOnly = (0, _reopt_ai_opt_charts.isDateOnly)(range.from) && (0, _reopt_ai_opt_charts.isDateOnly)(range.to);
|
|
2532
|
-
const from = (0, _reopt_ai_opt_charts.formatInstant)(window.from,
|
|
2533
|
-
const to = (0, _reopt_ai_opt_charts.formatInstant)(window.to,
|
|
3081
|
+
const from = (0, _reopt_ai_opt_charts.formatInstant)(window.from, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, options), {}, { dateOnly }));
|
|
3082
|
+
const to = (0, _reopt_ai_opt_charts.formatInstant)(window.to, require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, options), {}, { dateOnly }));
|
|
2534
3083
|
return {
|
|
2535
3084
|
text: from === to ? from : `${from} – ${to}`,
|
|
2536
3085
|
isInvalid: false
|
|
@@ -2561,7 +3110,7 @@ function describeRange(range, labels, options) {
|
|
|
2561
3110
|
*/
|
|
2562
3111
|
function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, locale, showUpdateButton = true, showWindowButtons = true, zoomFactor = .5, refresh, onRefreshChange, onRefresh, isLoading = false, disabled = false, className, labels: customLabels, "aria-label": ariaLabel }) {
|
|
2563
3112
|
var _refresh$interval, _refresh$paused, _refresh$interval2;
|
|
2564
|
-
const labels =
|
|
3113
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$4), customLabels), {}, { units: require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$4.units), customLabels === null || customLabels === void 0 ? void 0 : customLabels.units) });
|
|
2565
3114
|
const [open, setOpen] = (0, react.useState)(false);
|
|
2566
3115
|
const [draft, setDraft] = (0, react.useState)(null);
|
|
2567
3116
|
const [quickCount, setQuickCount] = (0, react.useState)("15");
|
|
@@ -2631,17 +3180,17 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2631
3180
|
});
|
|
2632
3181
|
const refreshLabel = !refresh || refresh.paused || refresh.interval === 0 ? labels.autoRefreshOff : labels.every((0, _reopt_ai_opt_charts.formatDuration)(refresh.interval, locale));
|
|
2633
3182
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2634
|
-
className:
|
|
3183
|
+
className: require_text_truncate.cn("bg-surface inline-flex items-center rounded-lg border", require_text_truncate.OPT_BORDER, className),
|
|
2635
3184
|
role: "group",
|
|
2636
3185
|
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : labels.trigger,
|
|
2637
3186
|
"data-opt-id": "3WJ8H",
|
|
2638
3187
|
"data-opt-slug": "time-range-control.TimeRangeControl",
|
|
2639
3188
|
children: [
|
|
2640
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3189
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.PopoverRoot, {
|
|
2641
3190
|
open,
|
|
2642
3191
|
onOpenChange: setOpen,
|
|
2643
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
2644
|
-
className:
|
|
3192
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.PopoverTrigger, {
|
|
3193
|
+
className: require_text_truncate.cn("text-text-primary h-10 gap-2", description.isInvalid && "text-danger-fg"),
|
|
2645
3194
|
disabled,
|
|
2646
3195
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Clock, {
|
|
2647
3196
|
className: "text-text-tertiary h-4 w-4",
|
|
@@ -2650,7 +3199,7 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2650
3199
|
className: "truncate text-sm",
|
|
2651
3200
|
children: description.text
|
|
2652
3201
|
})]
|
|
2653
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3202
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.PopoverContent, {
|
|
2654
3203
|
className: "gap-group flex w-80 flex-col",
|
|
2655
3204
|
children: [
|
|
2656
3205
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2661,7 +3210,7 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2661
3210
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2662
3211
|
className: "flex items-end gap-2",
|
|
2663
3212
|
children: [
|
|
2664
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3213
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Input, {
|
|
2665
3214
|
"aria-label": labels.quickSelect,
|
|
2666
3215
|
type: "number",
|
|
2667
3216
|
min: 1,
|
|
@@ -2673,18 +3222,18 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2673
3222
|
if (event.key === "Enter") applyQuick();
|
|
2674
3223
|
}
|
|
2675
3224
|
}),
|
|
2676
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3225
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectRoot, {
|
|
2677
3226
|
value: quickUnit,
|
|
2678
3227
|
setValue: (next) => setQuickUnit(selectValue(next)),
|
|
2679
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3228
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectTrigger, {
|
|
2680
3229
|
minWidth: 110,
|
|
2681
3230
|
"aria-label": labels.quickSelect
|
|
2682
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3231
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectPopover, { children: QUICK_UNITS.map((unit) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectItem, {
|
|
2683
3232
|
value: unit,
|
|
2684
3233
|
children: labels.units[unit]
|
|
2685
3234
|
}, unit)) })]
|
|
2686
3235
|
}),
|
|
2687
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3236
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Button, {
|
|
2688
3237
|
variant: "secondary",
|
|
2689
3238
|
size: "sm",
|
|
2690
3239
|
onClick: applyQuick,
|
|
@@ -2695,20 +3244,20 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2695
3244
|
}),
|
|
2696
3245
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2697
3246
|
className: "gap-element flex flex-col",
|
|
2698
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3247
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Input, {
|
|
2699
3248
|
label: labels.start,
|
|
2700
3249
|
size: "sm",
|
|
2701
3250
|
value: editing.from,
|
|
2702
3251
|
error: boundState(editing.from),
|
|
2703
3252
|
hint: labels.startHint,
|
|
2704
|
-
onChange: (event) => setDraft(
|
|
3253
|
+
onChange: (event) => setDraft(require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, editing), {}, { from: event.target.value })),
|
|
2705
3254
|
onKeyDown: commitOnEnter
|
|
2706
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3255
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Input, {
|
|
2707
3256
|
label: labels.end,
|
|
2708
3257
|
size: "sm",
|
|
2709
3258
|
value: editing.to,
|
|
2710
3259
|
error: boundState(editing.to),
|
|
2711
|
-
onChange: (event) => setDraft(
|
|
3260
|
+
onChange: (event) => setDraft(require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, editing), {}, { to: event.target.value })),
|
|
2712
3261
|
onKeyDown: commitOnEnter
|
|
2713
3262
|
})]
|
|
2714
3263
|
}),
|
|
@@ -2733,7 +3282,7 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2733
3282
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2734
3283
|
className: "text-text-primary text-xs font-medium",
|
|
2735
3284
|
children: labels.autoRefresh
|
|
2736
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3285
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_text_truncate.SelectRoot, {
|
|
2737
3286
|
value: String((refresh === null || refresh === void 0 ? void 0 : refresh.paused) ? 0 : (_refresh$interval2 = refresh === null || refresh === void 0 ? void 0 : refresh.interval) !== null && _refresh$interval2 !== void 0 ? _refresh$interval2 : 0),
|
|
2738
3287
|
setValue: (next) => {
|
|
2739
3288
|
const interval = Number(selectValue(next));
|
|
@@ -2742,10 +3291,10 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2742
3291
|
paused: interval === 0
|
|
2743
3292
|
});
|
|
2744
3293
|
},
|
|
2745
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3294
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectTrigger, {
|
|
2746
3295
|
minWidth: 140,
|
|
2747
3296
|
"aria-label": labels.autoRefresh
|
|
2748
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3297
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectPopover, { children: REFRESH_INTERVALS.map((interval) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.SelectItem, {
|
|
2749
3298
|
value: String(interval),
|
|
2750
3299
|
children: interval === 0 ? labels.autoRefreshOff : labels.every((0, _reopt_ai_opt_charts.formatDuration)(interval, locale))
|
|
2751
3300
|
}, interval)) })]
|
|
@@ -2755,7 +3304,7 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2755
3304
|
})]
|
|
2756
3305
|
}),
|
|
2757
3306
|
showWindowButtons && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2758
|
-
className:
|
|
3307
|
+
className: require_text_truncate.cn("flex items-center border-l", "border border-border"),
|
|
2759
3308
|
role: "group",
|
|
2760
3309
|
"aria-label": labels.previous,
|
|
2761
3310
|
children: [
|
|
@@ -2798,8 +3347,8 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2798
3347
|
]
|
|
2799
3348
|
}),
|
|
2800
3349
|
(onRefresh || showUpdateButton) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2801
|
-
className:
|
|
2802
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3350
|
+
className: require_text_truncate.cn("border-l pl-2 pr-2", "border border-border"),
|
|
3351
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Button, {
|
|
2803
3352
|
variant: hasChanges ? "primary" : "secondary",
|
|
2804
3353
|
size: "sm",
|
|
2805
3354
|
loading: isLoading,
|
|
@@ -2818,7 +3367,7 @@ function TimeRangeControl({ value, onChange, presets, recentRanges, timeZone, lo
|
|
|
2818
3367
|
}
|
|
2819
3368
|
TimeRangeControl.displayName = "TimeRangeControl";
|
|
2820
3369
|
function IconButton({ label, disabled, onClick, children }) {
|
|
2821
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3370
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Button, {
|
|
2822
3371
|
variant: "ghost",
|
|
2823
3372
|
size: "sm",
|
|
2824
3373
|
"aria-label": label,
|
|
@@ -2838,7 +3387,7 @@ function RangeList({ title, items, onPick }) {
|
|
|
2838
3387
|
className: "grid grid-cols-2 gap-1",
|
|
2839
3388
|
children: items.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2840
3389
|
type: "button",
|
|
2841
|
-
className:
|
|
3390
|
+
className: require_text_truncate.cn("hover:bg-bg-subtle w-full cursor-pointer rounded px-2 py-1 text-left text-xs", require_text_truncate.OPT_TEXT_SECONDARY),
|
|
2842
3391
|
onClick: () => onPick(item.range),
|
|
2843
3392
|
children: item.label
|
|
2844
3393
|
}) }, `${item.label}-${index}`))
|
|
@@ -2939,7 +3488,7 @@ const defaultLabels$3 = {
|
|
|
2939
3488
|
* ```
|
|
2940
3489
|
*/
|
|
2941
3490
|
function TimeSeriesPanel({ title, description, actions, data, series, range, onRangeChange, granularity = "auto", timeZone, locale, showRangeControl = true, presets, recentRanges, refresh, onRefreshChange, onRefresh, toggleableLegend = false, annotations, isLoading = false, height = 280, className, chartProps, labels: customLabels, "aria-label": ariaLabel }) {
|
|
2942
|
-
const labels =
|
|
3491
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$3), customLabels);
|
|
2943
3492
|
const [history, setHistory] = (0, react.useState)([]);
|
|
2944
3493
|
const [hidden, setHidden] = (0, react.useState)([]);
|
|
2945
3494
|
const resolved = (0, react.useMemo)(() => (0, _reopt_ai_opt_charts.resolveTimeRange)(range, { timeZone }), [range, timeZone]);
|
|
@@ -2963,7 +3512,7 @@ function TimeSeriesPanel({ title, description, actions, data, series, range, onR
|
|
|
2963
3512
|
setHidden((current) => current.includes(dataKey) ? current.filter((key) => key !== dataKey) : [...current, dataKey]);
|
|
2964
3513
|
}, []);
|
|
2965
3514
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2966
|
-
className:
|
|
3515
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_SURFACE, require_text_truncate.OPT_BORDER, "flex flex-col", className),
|
|
2967
3516
|
"aria-label": ariaLabel,
|
|
2968
3517
|
"data-opt-id": "Y0XCY",
|
|
2969
3518
|
"data-opt-slug": "time-series-panel.TimeSeriesPanel",
|
|
@@ -2975,13 +3524,13 @@ function TimeSeriesPanel({ title, description, actions, data, series, range, onR
|
|
|
2975
3524
|
className: "text-text-primary truncate text-base font-semibold",
|
|
2976
3525
|
children: title
|
|
2977
3526
|
}), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2978
|
-
className:
|
|
3527
|
+
className: require_text_truncate.cn("text-text-secondary", "truncate text-sm"),
|
|
2979
3528
|
children: description
|
|
2980
3529
|
})]
|
|
2981
3530
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2982
3531
|
className: "gap-element flex flex-wrap items-center",
|
|
2983
3532
|
children: [
|
|
2984
|
-
history.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3533
|
+
history.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Button, {
|
|
2985
3534
|
variant: "ghost",
|
|
2986
3535
|
size: "sm",
|
|
2987
3536
|
onClick: goBack,
|
|
@@ -3009,7 +3558,7 @@ function TimeSeriesPanel({ title, description, actions, data, series, range, onR
|
|
|
3009
3558
|
})]
|
|
3010
3559
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3011
3560
|
className: "px-2 pb-4",
|
|
3012
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_charts.TimeSeriesChart,
|
|
3561
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_charts.TimeSeriesChart, require_text_truncate._objectSpread2({
|
|
3013
3562
|
data,
|
|
3014
3563
|
series: visibleSeries,
|
|
3015
3564
|
from: resolved === null || resolved === void 0 ? void 0 : resolved.from,
|
|
@@ -3120,7 +3669,7 @@ function columnStyle(column) {
|
|
|
3120
3669
|
* ```
|
|
3121
3670
|
*/
|
|
3122
3671
|
function LogTableInner({ rows, columns, getRowId, selectedId = null, onSelect, onLoadMore, hasMore = false, loadingMore = false, prepending = false, onFollowChange, isNew, sort = null, onSortChange, onCellAction, highlightTerms, onColumnMove, density = "normal", showHeader = true, emptyState, labels: customLabels, className }, ref) {
|
|
3123
|
-
const labels =
|
|
3672
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$2), customLabels);
|
|
3124
3673
|
const rowHeight = ROW_HEIGHT[density];
|
|
3125
3674
|
const scrollRef = (0, react.useRef)(null);
|
|
3126
3675
|
const [scrollTop, setScrollTop] = (0, react.useState)(0);
|
|
@@ -3244,7 +3793,7 @@ function LogTableInner({ rows, columns, getRowId, selectedId = null, onSelect, o
|
|
|
3244
3793
|
lastVisible
|
|
3245
3794
|
]);
|
|
3246
3795
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3247
|
-
className:
|
|
3796
|
+
className: require_text_truncate.cn("@container/log flex min-h-0 flex-col", className),
|
|
3248
3797
|
"data-opt-id": "3ZR82",
|
|
3249
3798
|
"data-opt-slug": "log-table.LogTable",
|
|
3250
3799
|
children: [showHeader && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LogTableHeader, {
|
|
@@ -3287,13 +3836,13 @@ function LogTableInner({ rows, columns, getRowId, selectedId = null, onSelect, o
|
|
|
3287
3836
|
}),
|
|
3288
3837
|
loadingMore && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3289
3838
|
className: "gap-element text-text-tertiary flex items-center justify-center py-3 text-xs",
|
|
3290
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3839
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Spinner, {
|
|
3291
3840
|
size: "sm",
|
|
3292
3841
|
"aria-hidden": true
|
|
3293
3842
|
}), labels.loadingMore]
|
|
3294
3843
|
}),
|
|
3295
3844
|
!hasMore && rows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3296
|
-
className:
|
|
3845
|
+
className: require_text_truncate.cn("text-text-tertiary", "py-3 text-center text-xs"),
|
|
3297
3846
|
children: labels.endOfResults
|
|
3298
3847
|
})
|
|
3299
3848
|
]
|
|
@@ -3310,7 +3859,7 @@ const LogTable = (0, react.forwardRef)(LogTableInner);
|
|
|
3310
3859
|
function LogTableHeader({ columns, sort, onSortChange, onColumnMove, density, labels }) {
|
|
3311
3860
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3312
3861
|
role: "row",
|
|
3313
|
-
className:
|
|
3862
|
+
className: require_text_truncate.cn("border-border-subtle text-text-tertiary flex shrink-0 items-center gap-3 border-b px-3", DENSITY_TEXT[density]),
|
|
3314
3863
|
style: { height: ROW_HEIGHT[density] },
|
|
3315
3864
|
children: columns.map((column, index) => {
|
|
3316
3865
|
var _column$priority;
|
|
@@ -3337,7 +3886,7 @@ function LogTableHeader({ columns, sort, onSortChange, onColumnMove, density, la
|
|
|
3337
3886
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3338
3887
|
role: "columnheader",
|
|
3339
3888
|
"aria-sort": active ? sort.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
3340
|
-
className:
|
|
3889
|
+
className: require_text_truncate.cn("group/header flex items-center gap-1.5", column.align === "right" && "justify-end", HIDE_BELOW[(_column$priority = column.priority) !== null && _column$priority !== void 0 ? _column$priority : "always"]),
|
|
3341
3890
|
style: columnStyle(column),
|
|
3342
3891
|
children: [sortable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3343
3892
|
type: "button",
|
|
@@ -3349,7 +3898,7 @@ function LogTableHeader({ columns, sort, onSortChange, onColumnMove, density, la
|
|
|
3349
3898
|
}),
|
|
3350
3899
|
children: content
|
|
3351
3900
|
}) : content, onColumnMove && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3352
|
-
className:
|
|
3901
|
+
className: require_text_truncate.cn("ml-auto flex shrink-0 items-center gap-0.5", "opacity-0 transition-opacity", "group-hover/header:opacity-100 focus-within:opacity-100"),
|
|
3353
3902
|
children: [index > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3354
3903
|
type: "button",
|
|
3355
3904
|
className: "hover:text-text-primary cursor-pointer",
|
|
@@ -3393,13 +3942,13 @@ function LogTableRowImpl({ id, row, columns, top, height, density, selected, isN
|
|
|
3393
3942
|
top,
|
|
3394
3943
|
height
|
|
3395
3944
|
},
|
|
3396
|
-
className:
|
|
3945
|
+
className: require_text_truncate.cn("border-border-subtle/60 absolute inset-x-0 flex items-center gap-3 border-b px-3", DENSITY_TEXT[density], onSelect && "cursor-pointer", "transition-colors duration-100", "hover:bg-surface-hover", selected && "bg-accent-subtle hover:bg-accent-subtle", isNew && !selected && "opt-log-row-enter"),
|
|
3397
3946
|
children: columns.map((column) => {
|
|
3398
3947
|
var _column$priority2;
|
|
3399
3948
|
const raw = column.value(row);
|
|
3400
3949
|
const text = raw === null || raw === void 0 || raw === "" ? "" : String(raw);
|
|
3401
3950
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3402
|
-
className:
|
|
3951
|
+
className: require_text_truncate.cn("group/cell relative flex min-w-0 items-center gap-1.5", column.align === "right" && "justify-end", HIDE_BELOW[(_column$priority2 = column.priority) !== null && _column$priority2 !== void 0 ? _column$priority2 : "always"]),
|
|
3403
3952
|
style: columnStyle(column),
|
|
3404
3953
|
children: [
|
|
3405
3954
|
column.marker && text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -3408,9 +3957,16 @@ function LogTableRowImpl({ id, row, columns, top, height, density, selected, isN
|
|
|
3408
3957
|
style: { backgroundColor: `hsl(${hueOf(text)} 65% 55%)` }
|
|
3409
3958
|
}),
|
|
3410
3959
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3411
|
-
className:
|
|
3412
|
-
title: text || void 0,
|
|
3413
|
-
children: column.render ? column.render(row) : text ?
|
|
3960
|
+
className: require_text_truncate.cn("min-w-0 flex-1", !column.truncate && "truncate", column.mono && "font-mono", text ? "text-text-secondary" : ABSENT),
|
|
3961
|
+
title: column.truncate ? void 0 : text || void 0,
|
|
3962
|
+
children: column.render ? column.render(row) : text ? column.truncate ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.TextTruncate, {
|
|
3963
|
+
text,
|
|
3964
|
+
truncation: column.truncate,
|
|
3965
|
+
children: (shown) => highlightTerms && highlightTerms.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Highlight, {
|
|
3966
|
+
text: shown,
|
|
3967
|
+
search: highlightTerms
|
|
3968
|
+
}) : shown
|
|
3969
|
+
}) : highlightTerms && highlightTerms.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Highlight, {
|
|
3414
3970
|
text,
|
|
3415
3971
|
search: highlightTerms
|
|
3416
3972
|
}) : text : EM_DASH
|
|
@@ -3442,7 +3998,7 @@ const LogTableRow = (0, react.memo)(LogTableRowImpl);
|
|
|
3442
3998
|
function CellActions({ field, value, onAction, labels }) {
|
|
3443
3999
|
const button = "cursor-pointer rounded-sm p-0.5 text-text-tertiary hover:bg-bg-muted hover:text-text-primary";
|
|
3444
4000
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3445
|
-
className:
|
|
4001
|
+
className: require_text_truncate.cn("bg-surface/90 ml-auto flex shrink-0 items-center gap-0.5 rounded pl-1", "opacity-0 transition-opacity", "group-hover/cell:opacity-100 focus-within:opacity-100"),
|
|
3446
4002
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3447
4003
|
type: "button",
|
|
3448
4004
|
className: button,
|
|
@@ -3823,7 +4379,7 @@ const MAX_SUGGESTIONS = 8;
|
|
|
3823
4379
|
* ```
|
|
3824
4380
|
*/
|
|
3825
4381
|
function QueryBar({ value, onChange, fields = [], showClauses = false, live = false, disabled = false, className, labels: customLabels }) {
|
|
3826
|
-
const labels =
|
|
4382
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels$1), customLabels);
|
|
3827
4383
|
const inputRef = (0, react.useRef)(null);
|
|
3828
4384
|
const [text, setText] = (0, react.useState)(() => formatQuery(value));
|
|
3829
4385
|
const [focused, setFocused] = (0, react.useState)(false);
|
|
@@ -3881,12 +4437,12 @@ function QueryBar({ value, onChange, fields = [], showClauses = false, live = fa
|
|
|
3881
4437
|
};
|
|
3882
4438
|
const showSuggestions = focused && suggestions.length > 0;
|
|
3883
4439
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3884
|
-
className:
|
|
4440
|
+
className: require_text_truncate.cn("relative flex min-w-0 flex-col gap-1.5", className),
|
|
3885
4441
|
"data-opt-id": "JSVZ1",
|
|
3886
4442
|
"data-opt-slug": "query-bar.QueryBar",
|
|
3887
4443
|
children: [
|
|
3888
4444
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3889
|
-
className:
|
|
4445
|
+
className: require_text_truncate.cn("bg-surface flex h-9 items-center gap-2 rounded-md border px-2.5", require_text_truncate.OPT_BORDER, "focus-within:border-accent transition-colors", disabled && "opacity-60"),
|
|
3890
4446
|
children: [
|
|
3891
4447
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Search, {
|
|
3892
4448
|
className: "text-text-tertiary size-4 shrink-0",
|
|
@@ -3902,7 +4458,7 @@ function QueryBar({ value, onChange, fields = [], showClauses = false, live = fa
|
|
|
3902
4458
|
"aria-label": labels.ariaLabel,
|
|
3903
4459
|
placeholder: labels.placeholder,
|
|
3904
4460
|
disabled,
|
|
3905
|
-
className:
|
|
4461
|
+
className: require_text_truncate.cn("text-text-primary placeholder:text-text-tertiary min-w-0 flex-1", "bg-transparent font-mono text-sm outline-none focus-visible:outline-none"),
|
|
3906
4462
|
value: text,
|
|
3907
4463
|
onChange: (event) => {
|
|
3908
4464
|
setText(event.target.value);
|
|
@@ -3920,7 +4476,7 @@ function QueryBar({ value, onChange, fields = [], showClauses = false, live = fa
|
|
|
3920
4476
|
type: "button",
|
|
3921
4477
|
"aria-label": labels.clear,
|
|
3922
4478
|
title: labels.clear,
|
|
3923
|
-
className:
|
|
4479
|
+
className: require_text_truncate.cn("text-text-tertiary hover:text-text-primary cursor-pointer rounded-sm p-0.5", "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-ring-offset"),
|
|
3924
4480
|
onClick: () => {
|
|
3925
4481
|
setText("");
|
|
3926
4482
|
commit("");
|
|
@@ -3935,12 +4491,12 @@ function QueryBar({ value, onChange, fields = [], showClauses = false, live = fa
|
|
|
3935
4491
|
showSuggestions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
3936
4492
|
id: "query-bar-suggestions",
|
|
3937
4493
|
role: "listbox",
|
|
3938
|
-
className:
|
|
4494
|
+
className: require_text_truncate.cn("bg-surface-overlay absolute top-10 z-40 max-h-64 w-full overflow-y-auto rounded-md border p-1 shadow-lg", "border border-border"),
|
|
3939
4495
|
children: suggestions.map((suggestion, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3940
4496
|
type: "button",
|
|
3941
4497
|
role: "option",
|
|
3942
4498
|
"aria-selected": index === highlighted,
|
|
3943
|
-
className:
|
|
4499
|
+
className: require_text_truncate.cn("flex w-full cursor-pointer items-center justify-between gap-3 rounded px-2 py-1 text-left text-sm", index === highlighted ? "bg-bg-subtle" : "hover:bg-bg-subtle"),
|
|
3944
4500
|
onMouseEnter: () => setHighlighted(index),
|
|
3945
4501
|
onMouseDown: (event) => event.preventDefault(),
|
|
3946
4502
|
onClick: () => applySuggestion(suggestion),
|
|
@@ -3958,7 +4514,7 @@ function QueryBar({ value, onChange, fields = [], showClauses = false, live = fa
|
|
|
3958
4514
|
children: value.clauses.map((clause, index) => {
|
|
3959
4515
|
const label = describeClause(clause);
|
|
3960
4516
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
3961
|
-
className:
|
|
4517
|
+
className: require_text_truncate.cn("bg-bg-subtle text-text-secondary flex items-center gap-1 rounded px-1.5 py-0.5 text-xs", clause.negated && "text-danger-fg"),
|
|
3962
4518
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3963
4519
|
className: "truncate",
|
|
3964
4520
|
children: label
|
|
@@ -4083,7 +4639,7 @@ const defaultLabels = {
|
|
|
4083
4639
|
* ```
|
|
4084
4640
|
*/
|
|
4085
4641
|
function FieldSidebar({ fields, expandedField = null, onExpandedFieldChange, values, valuesLoading = false, sampledRows, onToggleColumn, onFilter, header, className, labels: customLabels }) {
|
|
4086
|
-
const labels =
|
|
4642
|
+
const labels = require_text_truncate._objectSpread2(require_text_truncate._objectSpread2({}, defaultLabels), customLabels);
|
|
4087
4643
|
const [search, setSearch] = (0, react.useState)("");
|
|
4088
4644
|
const groups = (0, react.useMemo)(() => {
|
|
4089
4645
|
const needle = search.trim().toLowerCase();
|
|
@@ -4100,14 +4656,14 @@ function FieldSidebar({ fields, expandedField = null, onExpandedFieldChange, val
|
|
|
4100
4656
|
}, [fields, search]);
|
|
4101
4657
|
const total = (0, react.useMemo)(() => (values !== null && values !== void 0 ? values : []).reduce((sum, entry) => sum + entry.count, 0), [values]);
|
|
4102
4658
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
|
|
4103
|
-
className:
|
|
4659
|
+
className: require_text_truncate.cn("flex min-h-0 flex-col", className),
|
|
4104
4660
|
"aria-label": labels.heading,
|
|
4105
4661
|
"data-opt-id": "17D4Y",
|
|
4106
4662
|
"data-opt-slug": "field-sidebar.FieldSidebar",
|
|
4107
4663
|
children: [
|
|
4108
4664
|
header,
|
|
4109
4665
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4110
|
-
className:
|
|
4666
|
+
className: require_text_truncate.cn("flex items-center gap-2 border-b px-3 py-2", "focus-within:border-accent transition-colors", require_text_truncate.OPT_BORDER),
|
|
4111
4667
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Search, {
|
|
4112
4668
|
className: "text-text-tertiary size-3.5 shrink-0",
|
|
4113
4669
|
"aria-hidden": true
|
|
@@ -4115,7 +4671,7 @@ function FieldSidebar({ fields, expandedField = null, onExpandedFieldChange, val
|
|
|
4115
4671
|
type: "search",
|
|
4116
4672
|
"aria-label": labels.searchLabel,
|
|
4117
4673
|
placeholder: labels.searchPlaceholder,
|
|
4118
|
-
className:
|
|
4674
|
+
className: require_text_truncate.cn("text-text-primary placeholder:text-text-tertiary min-w-0 flex-1", "bg-transparent text-sm outline-none focus-visible:outline-none"),
|
|
4119
4675
|
value: search,
|
|
4120
4676
|
onChange: (event) => setSearch(event.target.value)
|
|
4121
4677
|
})]
|
|
@@ -4123,10 +4679,10 @@ function FieldSidebar({ fields, expandedField = null, onExpandedFieldChange, val
|
|
|
4123
4679
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4124
4680
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
4125
4681
|
children: groups.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4126
|
-
className:
|
|
4682
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "px-3 py-4 text-xs"),
|
|
4127
4683
|
children: labels.empty
|
|
4128
4684
|
}) : groups.map(([group, groupFields]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { children: [group && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
4129
|
-
className:
|
|
4685
|
+
className: require_text_truncate.cn("text-text-tertiary", "px-3 pt-3 pb-1 text-[11px] font-medium tracking-wide uppercase"),
|
|
4130
4686
|
children: group
|
|
4131
4687
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: groupFields.map((field) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldRow, {
|
|
4132
4688
|
field,
|
|
@@ -4158,12 +4714,12 @@ function FieldRow({ field, expanded, onToggleExpanded, onToggleColumn, labels, c
|
|
|
4158
4714
|
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left",
|
|
4159
4715
|
"aria-expanded": expanded,
|
|
4160
4716
|
onClick: onToggleExpanded,
|
|
4161
|
-
children: [field.dataType ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4717
|
+
children: [field.dataType ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.FieldToken, {
|
|
4162
4718
|
type: field.dataType,
|
|
4163
4719
|
size: "xs",
|
|
4164
4720
|
title: (_field$type = field.type) !== null && _field$type !== void 0 ? _field$type : field.dataType
|
|
4165
4721
|
}) : field.type && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4166
|
-
className:
|
|
4722
|
+
className: require_text_truncate.cn("text-text-tertiary", "w-8 shrink-0 truncate font-mono text-[10px] uppercase"),
|
|
4167
4723
|
children: field.type
|
|
4168
4724
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4169
4725
|
className: "text-text-primary truncate font-mono text-xs",
|
|
@@ -4171,7 +4727,7 @@ function FieldRow({ field, expanded, onToggleExpanded, onToggleColumn, labels, c
|
|
|
4171
4727
|
})]
|
|
4172
4728
|
}), onToggleColumn && columnable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4173
4729
|
type: "button",
|
|
4174
|
-
className:
|
|
4730
|
+
className: require_text_truncate.cn("cursor-pointer rounded-sm p-0.5", field.inTable ? "text-accent" : "text-text-tertiary hover:text-text-primary opacity-0 group-hover/field:opacity-100 focus-visible:opacity-100"),
|
|
4175
4731
|
"aria-label": field.inTable ? labels.removeColumn(field.name) : labels.addColumn(field.name),
|
|
4176
4732
|
title: field.inTable ? labels.removeColumn(field.name) : labels.addColumn(field.name),
|
|
4177
4733
|
"aria-pressed": (_field$inTable = field.inTable) !== null && _field$inTable !== void 0 ? _field$inTable : false,
|
|
@@ -4194,21 +4750,21 @@ function FieldRow({ field, expanded, onToggleExpanded, onToggleColumn, labels, c
|
|
|
4194
4750
|
*/
|
|
4195
4751
|
function FieldValues({ values, loading, total, sampledRows, onFilter, labels }) {
|
|
4196
4752
|
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
4197
|
-
className:
|
|
4198
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4753
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "flex items-center gap-2 px-3 pb-2 text-xs"),
|
|
4754
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_text_truncate.Spinner, {
|
|
4199
4755
|
size: "sm",
|
|
4200
4756
|
"aria-hidden": true
|
|
4201
4757
|
}), labels.loadingValues]
|
|
4202
4758
|
});
|
|
4203
4759
|
if (!values || values.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4204
|
-
className:
|
|
4760
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "px-3 pb-2 text-xs"),
|
|
4205
4761
|
children: labels.noValues
|
|
4206
4762
|
});
|
|
4207
4763
|
const denominator = sampledRows !== null && sampledRows !== void 0 ? sampledRows : total;
|
|
4208
4764
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4209
4765
|
className: "flex flex-col gap-1 px-3 pt-1 pb-2",
|
|
4210
4766
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
4211
|
-
className:
|
|
4767
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "text-[11px]"),
|
|
4212
4768
|
children: [labels.topValues(values.length), sampledRows ? ` · ${sampledRows.toLocaleString()}` : ""]
|
|
4213
4769
|
}), values.map((entry) => {
|
|
4214
4770
|
var _entry$share;
|
|
@@ -4224,11 +4780,11 @@ function FieldValues({ values, loading, total, sampledRows, onFilter, labels })
|
|
|
4224
4780
|
children: entry.value || "—"
|
|
4225
4781
|
}),
|
|
4226
4782
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4227
|
-
className:
|
|
4783
|
+
className: require_text_truncate.cn(require_text_truncate.OPT_TEXT_TERTIARY, "shrink-0 text-[11px] tabular-nums"),
|
|
4228
4784
|
children: [Math.round(share * 100), "%"]
|
|
4229
4785
|
}),
|
|
4230
4786
|
onFilter && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4231
|
-
className:
|
|
4787
|
+
className: require_text_truncate.cn("flex shrink-0 items-center gap-0.5", "opacity-0 transition-opacity", "group-hover/value:opacity-100 focus-within:opacity-100"),
|
|
4232
4788
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4233
4789
|
type: "button",
|
|
4234
4790
|
className: "text-text-tertiary hover:text-text-primary cursor-pointer",
|
|
@@ -4396,6 +4952,12 @@ Object.defineProperty(exports, "EnvPanel", {
|
|
|
4396
4952
|
return EnvPanel;
|
|
4397
4953
|
}
|
|
4398
4954
|
});
|
|
4955
|
+
Object.defineProperty(exports, "EventTimeline", {
|
|
4956
|
+
enumerable: true,
|
|
4957
|
+
get: function() {
|
|
4958
|
+
return EventTimeline;
|
|
4959
|
+
}
|
|
4960
|
+
});
|
|
4399
4961
|
Object.defineProperty(exports, "FailureList", {
|
|
4400
4962
|
enumerable: true,
|
|
4401
4963
|
get: function() {
|
|
@@ -4414,6 +4976,12 @@ Object.defineProperty(exports, "FieldSidebar", {
|
|
|
4414
4976
|
return FieldSidebar;
|
|
4415
4977
|
}
|
|
4416
4978
|
});
|
|
4979
|
+
Object.defineProperty(exports, "Flyout", {
|
|
4980
|
+
enumerable: true,
|
|
4981
|
+
get: function() {
|
|
4982
|
+
return Flyout;
|
|
4983
|
+
}
|
|
4984
|
+
});
|
|
4417
4985
|
Object.defineProperty(exports, "KeyValueEditor", {
|
|
4418
4986
|
enumerable: true,
|
|
4419
4987
|
get: function() {
|
|
@@ -4444,6 +5012,12 @@ Object.defineProperty(exports, "QueryBar", {
|
|
|
4444
5012
|
return QueryBar;
|
|
4445
5013
|
}
|
|
4446
5014
|
});
|
|
5015
|
+
Object.defineProperty(exports, "ScoreBreakdown", {
|
|
5016
|
+
enumerable: true,
|
|
5017
|
+
get: function() {
|
|
5018
|
+
return ScoreBreakdown;
|
|
5019
|
+
}
|
|
5020
|
+
});
|
|
4447
5021
|
Object.defineProperty(exports, "SearchCombobox", {
|
|
4448
5022
|
enumerable: true,
|
|
4449
5023
|
get: function() {
|