@reopt-ai/opt-ui 1.7.0 → 1.9.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 +222 -34
- package/README.md +70 -6
- package/dist/core/index.cjs +170 -155
- package/dist/core/index.d.cts +3 -2
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.js +3 -3
- package/dist/docs/02-components/01-core.md +223 -18
- package/dist/docs/02-components/02-visuals.md +1 -1
- package/dist/docs/02-components/03-shells.md +17 -16
- package/dist/docs/02-components/04-surfaces.md +1 -1
- package/dist/docs/02-components/index.md +4 -4
- package/dist/{field-sidebar-CB8vjvUM.d.ts → field-sidebar-B5vk3luQ.d.cts} +30 -3
- package/dist/{field-sidebar-BTZCBviA.d.cts.map → field-sidebar-B5vk3luQ.d.cts.map} +1 -1
- package/dist/{field-sidebar-Cs-J-5VE.js → field-sidebar-B7QkWvMG.js} +52 -17
- package/dist/{field-sidebar-Cs-J-5VE.js.map → field-sidebar-B7QkWvMG.js.map} +1 -1
- package/dist/{field-sidebar-BTZCBviA.d.cts → field-sidebar-Dk9gJGA_.d.ts} +30 -3
- package/dist/{field-sidebar-CB8vjvUM.d.ts.map → field-sidebar-Dk9gJGA_.d.ts.map} +1 -1
- package/dist/{field-sidebar-CzIQX70-.cjs → field-sidebar-mFHemxBz.cjs} +328 -293
- package/dist/{types-D0FlcYnM.d.ts → field-token-CSOrU5gl.d.cts} +66 -2
- package/dist/field-token-CSOrU5gl.d.cts.map +1 -0
- package/dist/{types-D0FlcYnM.d.cts → field-token-CSOrU5gl.d.ts} +66 -2
- package/dist/field-token-CSOrU5gl.d.ts.map +1 -0
- package/dist/{pagination-DWbvACuN.js → highlight-C2sfnJN8.js} +263 -11
- package/dist/highlight-C2sfnJN8.js.map +1 -0
- package/dist/{pagination-DjfxBcjX.cjs → highlight-CGcrYGMC.cjs} +284 -8
- package/dist/id-registry.cjs +98 -2
- package/dist/id-registry.d.cts.map +1 -1
- package/dist/id-registry.d.ts.map +1 -1
- package/dist/id-registry.js +98 -2
- package/dist/id-registry.js.map +1 -1
- package/dist/id-registry.json +202 -4
- package/dist/index.cjs +664 -643
- package/dist/index.d.cts +5 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/{shader-surface-BUPZ0P-n.js → key-pad-menu-BFd79JoS.js} +855 -19
- package/dist/key-pad-menu-BFd79JoS.js.map +1 -0
- package/dist/{shader-surface-DRrcLrWf.d.cts → key-pad-menu-D8OS_VCT.d.cts} +459 -3
- package/dist/key-pad-menu-D8OS_VCT.d.cts.map +1 -0
- package/dist/{shader-surface-Fav5K9UC.cjs → key-pad-menu-DoGskWbp.cjs} +1103 -201
- package/dist/{shader-surface-BfTP9c1Q.d.ts → key-pad-menu-EEb6Ho5h.d.ts} +459 -3
- package/dist/key-pad-menu-EEb6Ho5h.d.ts.map +1 -0
- package/dist/meta.cjs +641 -0
- package/dist/meta.d.cts.map +1 -1
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +641 -0
- package/dist/meta.js.map +1 -1
- package/dist/shells/index.cjs +1 -1
- package/dist/shells/index.d.cts +1 -1
- package/dist/shells/index.d.ts +1 -1
- package/dist/shells/index.js +1 -1
- package/package.json +2 -2
- package/dist/pagination-DWbvACuN.js.map +0 -1
- package/dist/shader-surface-BUPZ0P-n.js.map +0 -1
- package/dist/shader-surface-BfTP9c1Q.d.ts.map +0 -1
- package/dist/shader-surface-DRrcLrWf.d.cts.map +0 -1
- package/dist/types-D0FlcYnM.d.cts.map +0 -1
- package/dist/types-D0FlcYnM.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as ToolbarContainer$1, $t as Spinner, A as FormSelectPopover, An as OPT_INPUT, At as DialogPanel$1, Bn as OPT_TEXT_PRIMARY, Bt as TabsRoot$1, C as FormRadio$1, D as FormRoot$1, Dn as OPT_FOCUS, En as OPT_DOT_YELLOW, Fn as OPT_TABLE_ROW_ACTIVE, Ft as SelectRoot$1, Gn as _objectWithoutProperties, Gt as CompositeItem, H as TagInput, Hn as OPT_TEXT_TERTIARY, Ht as DisclosureRoot$1, I as FormTextarea, In as OPT_TD, It as SelectTrigger$1, J as PopoverRoot$1, Kn as Kbd, Kt as CompositeProvider, Ln as OPT_TD_MUTED, Lt as Tab$1, Mn as OPT_ITEM_BASE, Mt as SelectItem$1, N as FormSubmit$1, Nn as OPT_SURFACE, Nt as SelectLabel$1, O as FormSelect, On as OPT_FOCUS_VISIBLE, P as FormSwitch$1, Pn as OPT_SURFACE_POPOVER, Pt as SelectPopover$1, Q as ToolbarButton$1, Qt as Alert, Rt as TabList$1, Sn as OPT_DIVIDER, Tn as OPT_DOT_RED, Un as OPT_TH, Ut as DisclosureTrigger$1, Vn as OPT_TEXT_SECONDARY, Vt as DisclosureContent$1, Wn as _objectSpread2, Wt as Composite, Xt as Input, Y as PopoverTrigger$1, _n as OPT_BADGE_RED, a as Pagination, at as MenuButtonArrow$1, bn as OPT_DISCLOSURE_CONTENT, bt as ComboboxPopover$1, c as FormCheckbox$1, ct as MenuItemRadio$1, dn as OPT_ACTIVE_ITEM, dt as MenuSeparator$1, en as Badge, et as ToolbarRoot$1, ft as MenuTrigger$1, gn as OPT_BADGE_NEUTRAL, hn as OPT_BADGE_GREEN, ht as ComboboxEmpty, it as TooltipProvider$1, jt as DialogRoot$1, k as FormSelectItem, kt as DialogHeading$1, lt as MenuPopover$1, mn as OPT_BADGE_BLUE, mt as MenubarRoot$1, nn as Button, nt as Tooltip$1, o as Checkbox, on as StatCard, ot as MenuItem$1, p as FormError$1, pn as OPT_ANIMATE_ENTER_EXIT, pt as MenubarContainer$1, q as PopoverContent$1, qn as cn, qt as CompositeRow, r as FieldToken, rt as TooltipAnchor$1, st as MenuItemCheckbox$1, t as Highlight, tn as EmptyState, tt as ToolbarSeparator$1, ut as MenuRoot$1, v as FormInput$1, vn as OPT_BADGE_YELLOW, vt as ComboboxInput$1, w as FormRadioGroup$1, wn as OPT_DOT_GREEN, wt as DialogDescription$1, xn as OPT_DISCLOSURE_TRIGGER, xt as ComboboxRoot$1, y as FormLabel$1, yn as OPT_BORDER, yt as ComboboxItem$1, z as useFormStore, zn as OPT_TEXT_LABEL, zt as TabPanel$1 } from "./highlight-C2sfnJN8.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Fragment as Fragment$1, createContext, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
@@ -3057,7 +3057,9 @@ const defaultLabels$2 = {
|
|
|
3057
3057
|
filterFor: (value) => `Filter for ${value}`,
|
|
3058
3058
|
filterOut: (value) => `Filter out ${value}`,
|
|
3059
3059
|
sortAscending: "Sort ascending",
|
|
3060
|
-
sortDescending: "Sort descending"
|
|
3060
|
+
sortDescending: "Sort descending",
|
|
3061
|
+
moveLeft: (column) => `Move ${column} left`,
|
|
3062
|
+
moveRight: (column) => `Move ${column} right`
|
|
3061
3063
|
};
|
|
3062
3064
|
/** Rows rendered beyond the viewport on each side, so a fast scroll stays filled. */
|
|
3063
3065
|
const OVERSCAN = 10;
|
|
@@ -3116,7 +3118,7 @@ function columnStyle(column) {
|
|
|
3116
3118
|
* />
|
|
3117
3119
|
* ```
|
|
3118
3120
|
*/
|
|
3119
|
-
function LogTableInner({ rows, columns, getRowId, selectedId = null, onSelect, onLoadMore, hasMore = false, loadingMore = false, prepending = false, onFollowChange, isNew, sort = null, onSortChange, onCellAction, density = "normal", showHeader = true, emptyState, labels: customLabels, className }, ref) {
|
|
3121
|
+
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) {
|
|
3120
3122
|
const labels = _objectSpread2(_objectSpread2({}, defaultLabels$2), customLabels);
|
|
3121
3123
|
const rowHeight = ROW_HEIGHT[density];
|
|
3122
3124
|
const scrollRef = useRef(null);
|
|
@@ -3242,12 +3244,13 @@ function LogTableInner({ rows, columns, getRowId, selectedId = null, onSelect, o
|
|
|
3242
3244
|
]);
|
|
3243
3245
|
return /* @__PURE__ */ jsxs("div", {
|
|
3244
3246
|
className: cn("@container/log flex min-h-0 flex-col", className),
|
|
3245
|
-
"data-opt-id": "
|
|
3247
|
+
"data-opt-id": "3ZR82",
|
|
3246
3248
|
"data-opt-slug": "log-table.LogTable",
|
|
3247
3249
|
children: [showHeader && /* @__PURE__ */ jsx(LogTableHeader, {
|
|
3248
3250
|
columns,
|
|
3249
3251
|
sort,
|
|
3250
3252
|
onSortChange,
|
|
3253
|
+
onColumnMove,
|
|
3251
3254
|
density,
|
|
3252
3255
|
labels
|
|
3253
3256
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -3276,6 +3279,7 @@ function LogTableInner({ rows, columns, getRowId, selectedId = null, onSelect, o
|
|
|
3276
3279
|
isNew: (_isNew = isNew === null || isNew === void 0 ? void 0 : isNew(row)) !== null && _isNew !== void 0 ? _isNew : false,
|
|
3277
3280
|
onSelect,
|
|
3278
3281
|
onCellAction,
|
|
3282
|
+
highlightTerms,
|
|
3279
3283
|
labels
|
|
3280
3284
|
}, id);
|
|
3281
3285
|
})
|
|
@@ -3302,15 +3306,16 @@ function LogTableInner({ rows, columns, getRowId, selectedId = null, onSelect, o
|
|
|
3302
3306
|
* widens it to its constraint and takes the column callbacks' types with it.
|
|
3303
3307
|
*/
|
|
3304
3308
|
const LogTable = forwardRef(LogTableInner);
|
|
3305
|
-
function LogTableHeader({ columns, sort, onSortChange, density, labels }) {
|
|
3309
|
+
function LogTableHeader({ columns, sort, onSortChange, onColumnMove, density, labels }) {
|
|
3306
3310
|
return /* @__PURE__ */ jsx("div", {
|
|
3307
3311
|
role: "row",
|
|
3308
3312
|
className: cn("border-border-subtle text-text-tertiary flex shrink-0 items-center gap-3 border-b px-3", DENSITY_TEXT[density]),
|
|
3309
3313
|
style: { height: ROW_HEIGHT[density] },
|
|
3310
|
-
children: columns.map((column) => {
|
|
3314
|
+
children: columns.map((column, index) => {
|
|
3311
3315
|
var _column$priority;
|
|
3312
3316
|
const active = (sort === null || sort === void 0 ? void 0 : sort.columnId) === column.id;
|
|
3313
3317
|
const sortable = column.sortable && onSortChange;
|
|
3318
|
+
const columnLabel = typeof column.header === "string" ? column.header : column.id;
|
|
3314
3319
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3315
3320
|
column.marker && /* @__PURE__ */ jsx("span", {
|
|
3316
3321
|
"aria-hidden": true,
|
|
@@ -3328,12 +3333,12 @@ function LogTableHeader({ columns, sort, onSortChange, density, labels }) {
|
|
|
3328
3333
|
"aria-hidden": true
|
|
3329
3334
|
}))
|
|
3330
3335
|
] });
|
|
3331
|
-
return /* @__PURE__ */
|
|
3336
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3332
3337
|
role: "columnheader",
|
|
3333
3338
|
"aria-sort": active ? sort.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
3334
|
-
className: cn("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"]),
|
|
3339
|
+
className: 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"]),
|
|
3335
3340
|
style: columnStyle(column),
|
|
3336
|
-
children: sortable ? /* @__PURE__ */ jsx("button", {
|
|
3341
|
+
children: [sortable ? /* @__PURE__ */ jsx("button", {
|
|
3337
3342
|
type: "button",
|
|
3338
3343
|
className: "hover:text-text-primary flex cursor-pointer items-center gap-1.5 truncate",
|
|
3339
3344
|
title: active && sort.direction === "desc" ? labels.sortAscending : labels.sortDescending,
|
|
@@ -3342,12 +3347,35 @@ function LogTableHeader({ columns, sort, onSortChange, density, labels }) {
|
|
|
3342
3347
|
direction: active && sort.direction === "desc" ? "asc" : "desc"
|
|
3343
3348
|
}),
|
|
3344
3349
|
children: content
|
|
3345
|
-
}) : content
|
|
3350
|
+
}) : content, onColumnMove && /* @__PURE__ */ jsxs("span", {
|
|
3351
|
+
className: cn("ml-auto flex shrink-0 items-center gap-0.5", "opacity-0 transition-opacity", "group-hover/header:opacity-100 focus-within:opacity-100"),
|
|
3352
|
+
children: [index > 0 && /* @__PURE__ */ jsx("button", {
|
|
3353
|
+
type: "button",
|
|
3354
|
+
className: "hover:text-text-primary cursor-pointer",
|
|
3355
|
+
"aria-label": labels.moveLeft(columnLabel),
|
|
3356
|
+
title: labels.moveLeft(columnLabel),
|
|
3357
|
+
onClick: () => onColumnMove(column.id, "left"),
|
|
3358
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, {
|
|
3359
|
+
className: "size-3",
|
|
3360
|
+
"aria-hidden": true
|
|
3361
|
+
})
|
|
3362
|
+
}), index < columns.length - 1 && /* @__PURE__ */ jsx("button", {
|
|
3363
|
+
type: "button",
|
|
3364
|
+
className: "hover:text-text-primary cursor-pointer",
|
|
3365
|
+
"aria-label": labels.moveRight(columnLabel),
|
|
3366
|
+
title: labels.moveRight(columnLabel),
|
|
3367
|
+
onClick: () => onColumnMove(column.id, "right"),
|
|
3368
|
+
children: /* @__PURE__ */ jsx(ChevronRight, {
|
|
3369
|
+
className: "size-3",
|
|
3370
|
+
"aria-hidden": true
|
|
3371
|
+
})
|
|
3372
|
+
})]
|
|
3373
|
+
})]
|
|
3346
3374
|
}, column.id);
|
|
3347
3375
|
})
|
|
3348
3376
|
});
|
|
3349
3377
|
}
|
|
3350
|
-
function LogTableRowImpl({ id, row, columns, top, height, density, selected, isNew, onSelect, onCellAction, labels }) {
|
|
3378
|
+
function LogTableRowImpl({ id, row, columns, top, height, density, selected, isNew, onSelect, onCellAction, highlightTerms, labels }) {
|
|
3351
3379
|
return /* @__PURE__ */ jsx("div", {
|
|
3352
3380
|
role: "option",
|
|
3353
3381
|
"aria-selected": selected,
|
|
@@ -3381,7 +3409,10 @@ function LogTableRowImpl({ id, row, columns, top, height, density, selected, isN
|
|
|
3381
3409
|
/* @__PURE__ */ jsx("span", {
|
|
3382
3410
|
className: cn("truncate", column.mono && "font-mono", text ? "text-text-secondary" : ABSENT),
|
|
3383
3411
|
title: text || void 0,
|
|
3384
|
-
children: column.render ? column.render(row) : text
|
|
3412
|
+
children: column.render ? column.render(row) : text ? highlightTerms && highlightTerms.length > 0 ? /* @__PURE__ */ jsx(Highlight, {
|
|
3413
|
+
text,
|
|
3414
|
+
search: highlightTerms
|
|
3415
|
+
}) : text : EM_DASH
|
|
3385
3416
|
}),
|
|
3386
3417
|
onCellAction && column.field && text && /* @__PURE__ */ jsx(CellActions, {
|
|
3387
3418
|
field: column.field,
|
|
@@ -3410,7 +3441,7 @@ const LogTableRow = memo(LogTableRowImpl);
|
|
|
3410
3441
|
function CellActions({ field, value, onAction, labels }) {
|
|
3411
3442
|
const button = "cursor-pointer rounded-sm p-0.5 text-text-tertiary hover:bg-bg-muted hover:text-text-primary";
|
|
3412
3443
|
return /* @__PURE__ */ jsxs("span", {
|
|
3413
|
-
className: cn("bg-surface/90 ml-auto
|
|
3444
|
+
className: 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"),
|
|
3414
3445
|
children: [/* @__PURE__ */ jsx("button", {
|
|
3415
3446
|
type: "button",
|
|
3416
3447
|
className: button,
|
|
@@ -4117,7 +4148,7 @@ function FieldSidebar({ fields, expandedField = null, onExpandedFieldChange, val
|
|
|
4117
4148
|
}
|
|
4118
4149
|
FieldSidebar.displayName = "FieldSidebar";
|
|
4119
4150
|
function FieldRow({ field, expanded, onToggleExpanded, onToggleColumn, labels, children }) {
|
|
4120
|
-
var _field$columnable, _field$inTable;
|
|
4151
|
+
var _field$columnable, _field$type, _field$inTable;
|
|
4121
4152
|
const columnable = (_field$columnable = field.columnable) !== null && _field$columnable !== void 0 ? _field$columnable : true;
|
|
4122
4153
|
return /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsxs("div", {
|
|
4123
4154
|
className: "hover:bg-bg-subtle group/field flex items-center gap-1.5 px-3 py-1",
|
|
@@ -4126,7 +4157,11 @@ function FieldRow({ field, expanded, onToggleExpanded, onToggleColumn, labels, c
|
|
|
4126
4157
|
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-left",
|
|
4127
4158
|
"aria-expanded": expanded,
|
|
4128
4159
|
onClick: onToggleExpanded,
|
|
4129
|
-
children: [field.
|
|
4160
|
+
children: [field.dataType ? /* @__PURE__ */ jsx(FieldToken, {
|
|
4161
|
+
type: field.dataType,
|
|
4162
|
+
size: "xs",
|
|
4163
|
+
title: (_field$type = field.type) !== null && _field$type !== void 0 ? _field$type : field.dataType
|
|
4164
|
+
}) : field.type && /* @__PURE__ */ jsx("span", {
|
|
4130
4165
|
className: cn("text-text-tertiary", "w-8 shrink-0 truncate font-mono text-[10px] uppercase"),
|
|
4131
4166
|
children: field.type
|
|
4132
4167
|
}), /* @__PURE__ */ jsx("span", {
|
|
@@ -4192,7 +4227,7 @@ function FieldValues({ values, loading, total, sampledRows, onFilter, labels })
|
|
|
4192
4227
|
children: [Math.round(share * 100), "%"]
|
|
4193
4228
|
}),
|
|
4194
4229
|
onFilter && /* @__PURE__ */ jsxs("span", {
|
|
4195
|
-
className: "
|
|
4230
|
+
className: cn("flex shrink-0 items-center gap-0.5", "opacity-0 transition-opacity", "group-hover/value:opacity-100 focus-within:opacity-100"),
|
|
4196
4231
|
children: [/* @__PURE__ */ jsx("button", {
|
|
4197
4232
|
type: "button",
|
|
4198
4233
|
className: "text-text-tertiary hover:text-text-primary cursor-pointer",
|
|
@@ -4230,4 +4265,4 @@ function FieldValues({ values, loading, total, sampledRows, onFilter, labels })
|
|
|
4230
4265
|
//#endregion
|
|
4231
4266
|
export { CommandList$1 as $, DataTable as A, SidebarNav as B, WorkflowCanvas as C, ToastProvider as D, NotificationToast as E, DeploymentTimeline as F, CommandPaletteTrigger as G, StatusSelect as H, SettingsForm as I, CommandDialog as J, CommandPalette as K, FaqAccordion as L, BranchSelect as M, EnvPanel as N, toast as O, ProjectSwitcher as P, CommandItem$1 as Q, ContentTabs as R, useAutoRefresh as S, FailureList as T, SearchCombobox as U, AppMenubar as V, DashboardGrid as W, CommandGroup$1 as X, CommandEmpty$1 as Y, CommandInput$1 as Z, withoutField as _, formatQuery as a, DEFAULT_TIME_PRESETS as b, parseQueryWithDiagnostics as c, applyCellAction as d, CommandSeparator$1 as et, fieldValues as f, withFieldValue as g, removeClause as h, formatClause as i, DomainTable as j, useToast as k, EMPTY_QUERY as l, queryFields as m, QueryBar as n, quoteValue as o, isEmptyQuery as p, Command as q, describeClause as r, parseQuery as s, FieldSidebar as t, CommandShortcut as tt, addClause as u, LogTable as v, KeyValueEditor as w, TimeRangeControl as x, TimeSeriesPanel as y, EditorToolbar as z };
|
|
4232
4267
|
|
|
4233
|
-
//# sourceMappingURL=field-sidebar-
|
|
4268
|
+
//# sourceMappingURL=field-sidebar-B7QkWvMG.js.map
|