@upbound/monarch-blocks 0.13.3 → 0.15.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/dist/chat-interface.js.map +1 -1
- package/dist/data-table.d.ts +2 -2
- package/dist/data-table.js +46 -20
- package/dist/data-table.js.map +1 -1
- package/dist/{empty-view-DQt8-Ho8.d.ts → empty-view-DHTvKsil.d.ts} +3 -0
- package/dist/graph.css +13 -0
- package/dist/graph.d.ts +15 -3
- package/dist/graph.js +95 -59
- package/dist/graph.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +136 -68
- package/dist/index.js.map +1 -1
- package/dist/page-header.js +7 -1
- package/dist/page-header.js.map +1 -1
- package/dist/relative-time.d.ts +2 -2
- package/dist/relative-time.js +4 -4
- package/dist/relative-time.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { IconName } from '@upbound/monarch-core';
|
|
3
4
|
import { RowData, Cell, columnFilteringFeature, globalFilteringFeature, columnFacetingFeature, rowSortingFeature, rowPaginationFeature, rowExpandingFeature, columnGroupingFeature, columnOrderingFeature, columnPinningFeature, columnVisibilityFeature, columnSizingFeature, columnResizingFeature, createFilteredRowModel, createFacetedRowModel, createFacetedUniqueValues, createSortedRowModel, createPaginatedRowModel, createGroupedRowModel, createExpandedRowModel, filterFns, sortFns, Column, TableOptions, Row, ColumnDef, HeaderGroup, Header, ReactTable, TableFeatures } from '@tanstack/react-table';
|
|
4
5
|
|
|
@@ -177,6 +178,8 @@ declare module '@tanstack/react-table' {
|
|
|
177
178
|
interface ColumnMeta<TFeatures extends TableFeatures, TData extends RowData, TValue> {
|
|
178
179
|
/** Pins the column to the inline start or end edge. Pinned columns are excluded from column reordering. */
|
|
179
180
|
pinning?: 'start' | 'end';
|
|
181
|
+
/** Explains the column's data in a tooltip on the header label. Without it, the header label has no tooltip. */
|
|
182
|
+
headerTooltip?: ReactNode;
|
|
180
183
|
/** Marks an actions column — hides its header label and excludes it from contextual filtering. */
|
|
181
184
|
actions?: boolean;
|
|
182
185
|
/**
|
package/dist/graph.css
CHANGED
|
@@ -32,15 +32,28 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.react-flow__controls-button {
|
|
35
|
+
width: 20px;
|
|
36
|
+
height: 20px;
|
|
37
|
+
padding: 6px;
|
|
35
38
|
background: var(--card);
|
|
36
39
|
border-bottom: 1px solid var(--border);
|
|
37
40
|
color: var(--foreground);
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
.react-flow__controls-button svg {
|
|
44
|
+
max-width: 10px;
|
|
45
|
+
max-height: 10px;
|
|
41
46
|
fill: var(--foreground);
|
|
42
47
|
}
|
|
43
48
|
|
|
49
|
+
.react-flow__controls-button:last-child {
|
|
50
|
+
border-bottom: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.react-flow__background circle {
|
|
54
|
+
fill: var(--border);
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
.react-flow__controls-button:hover {
|
|
45
58
|
background: var(--accent);
|
|
46
59
|
}
|
package/dist/graph.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Node, NodeProps, Edge, EdgeProps, NodeTypes, EdgeTypes } from 'reactflo
|
|
|
2
2
|
export { Edge, Node } from 'reactflow';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ColumnFiltersState } from '@tanstack/react-table';
|
|
5
|
-
import { T as TableDataState } from './empty-view-
|
|
5
|
+
import { T as TableDataState } from './empty-view-DHTvKsil.js';
|
|
6
6
|
import { DataTableColumnDef, DataTableEmptyConfig } from './data-table.js';
|
|
7
7
|
import '@upbound/monarch-core';
|
|
8
8
|
|
|
@@ -43,7 +43,7 @@ type NodeDefault<T extends object = object> = Node<NodeData<T>> & {
|
|
|
43
43
|
};
|
|
44
44
|
declare function isDefaultNode(node: NodeLoading | NodeDefault): node is NodeDefault;
|
|
45
45
|
type GraphNodeProps<T extends NodeData | {}> = NodeProps<T>;
|
|
46
|
-
declare function GraphNode<T extends NodeData = NodeData>({ id, data, ...props }: GraphNodeProps<T>): React.JSX.Element;
|
|
46
|
+
declare function GraphNode<T extends NodeData = NodeData>({ id, data, selected, ...props }: GraphNodeProps<T>): React.JSX.Element;
|
|
47
47
|
declare function GraphNodeSkeleton(_props: NodeProps<{}>): React.JSX.Element;
|
|
48
48
|
|
|
49
49
|
interface GraphActionsProviderProps {
|
|
@@ -88,6 +88,12 @@ interface GraphProps<T extends object> {
|
|
|
88
88
|
loading?: boolean;
|
|
89
89
|
showError?: boolean;
|
|
90
90
|
className?: string;
|
|
91
|
+
/** Classes for the graph canvas (not the toolbar). Defaults to `rounded-xl border`. */
|
|
92
|
+
canvasClassName?: string;
|
|
93
|
+
/** Hide the canvas minimap. Defaults to `false`. */
|
|
94
|
+
hideMiniMap?: boolean;
|
|
95
|
+
/** Hide the canvas zoom controls (zoom in, zoom out, fit view). Defaults to `false`. */
|
|
96
|
+
hideControls?: boolean;
|
|
91
97
|
emptyView?: GraphEmptyView;
|
|
92
98
|
ActionsComponent?: React.ComponentType<{
|
|
93
99
|
state: GraphDataState;
|
|
@@ -102,7 +108,7 @@ interface GraphProps<T extends object> {
|
|
|
102
108
|
declare const defaultGraphErrorConfig: DataTableEmptyConfig;
|
|
103
109
|
declare const defaultGraphEmptyConfig: DataTableEmptyConfig;
|
|
104
110
|
declare const defaultGraphNoFilterFoundConfig: DataTableEmptyConfig;
|
|
105
|
-
declare function Graph<T extends object>({ id, viewportFocusNodeId, config, columnDefinitions, title, emptyView, showError, className, loading, ActionsComponent: Actions, disableSearch, disableFilters, searchTerm: parentGlobalFilter, onSearchTermChange: parentSetGlobalFilter, filters: parentColumnFilters, onFiltersChange: parentSetColumnFilters, children, }: React.PropsWithChildren<GraphProps<T>>): React.JSX.Element;
|
|
111
|
+
declare function Graph<T extends object>({ id, viewportFocusNodeId, config, columnDefinitions, title, emptyView, showError, className, canvasClassName, hideMiniMap, hideControls, loading, ActionsComponent: Actions, disableSearch, disableFilters, searchTerm: parentGlobalFilter, onSearchTermChange: parentSetGlobalFilter, filters: parentColumnFilters, onFiltersChange: parentSetColumnFilters, children, }: React.PropsWithChildren<GraphProps<T>>): React.JSX.Element;
|
|
106
112
|
|
|
107
113
|
declare const GraphView: React.ForwardRefExoticComponent<{
|
|
108
114
|
viewportFocusNodeId?: string;
|
|
@@ -111,6 +117,12 @@ declare const GraphView: React.ForwardRefExoticComponent<{
|
|
|
111
117
|
nodeTypes?: NodeTypes;
|
|
112
118
|
edgeTypes?: EdgeTypes;
|
|
113
119
|
children?: React.ReactNode;
|
|
120
|
+
/** Classes for the canvas container. Defaults to `rounded-xl border`; override e.g. with `rounded-none border-0`. */
|
|
121
|
+
className?: string;
|
|
122
|
+
/** Hide the minimap in the bottom-right corner. Defaults to `false`. */
|
|
123
|
+
hideMiniMap?: boolean;
|
|
124
|
+
/** Hide the zoom controls (zoom in, zoom out, fit view). Defaults to `false`. */
|
|
125
|
+
hideControls?: boolean;
|
|
114
126
|
} & {
|
|
115
127
|
children?: React.ReactNode | undefined;
|
|
116
128
|
} & React.RefAttributes<GraphActionsProviderRef>>;
|
package/dist/graph.js
CHANGED
|
@@ -50,7 +50,7 @@ import { useCallback as useCallback2, useState } from "react";
|
|
|
50
50
|
// src/graph/graph-node.tsx
|
|
51
51
|
import * as React from "react";
|
|
52
52
|
import { getIncomers, getOutgoers, Handle, Position as Position2 } from "reactflow";
|
|
53
|
-
import { Badge, Card, Icon,
|
|
53
|
+
import { Badge, Button, Card, Icon, Tooltip, TooltipContent, TooltipTrigger } from "@upbound/monarch-core";
|
|
54
54
|
|
|
55
55
|
// src/lib/utils.ts
|
|
56
56
|
import { cn } from "@upbound/monarch-core/utils";
|
|
@@ -105,7 +105,7 @@ function isDefaultNode(node) {
|
|
|
105
105
|
return node.type !== "loading";
|
|
106
106
|
}
|
|
107
107
|
function GraphNode(_a) {
|
|
108
|
-
var _b = _a, { id, data } = _b, props = __objRest(_b, ["id", "data"]);
|
|
108
|
+
var _b = _a, { id, data, selected } = _b, props = __objRest(_b, ["id", "data", "selected"]);
|
|
109
109
|
var _a2, _b2;
|
|
110
110
|
const { nodes: originalNodes, edges: originalEdges } = useGraphActionsContext();
|
|
111
111
|
const nodes = originalNodes;
|
|
@@ -165,10 +165,11 @@ function GraphNode(_a) {
|
|
|
165
165
|
Card,
|
|
166
166
|
{
|
|
167
167
|
className: cn(
|
|
168
|
-
"relative gap-1.5 overflow-visible rounded-
|
|
168
|
+
"relative gap-1.5 overflow-visible rounded-xl py-0",
|
|
169
169
|
`flex h-[106px]! w-[260px]! flex-col pt-2.5! pb-0!`,
|
|
170
170
|
`hover:shadow-md motion-safe:transition-shadow`,
|
|
171
|
-
compact && `h-[47px]
|
|
171
|
+
compact && `h-[47px]!`,
|
|
172
|
+
(selected || data.isHighlighted) && "ring-primary ring-2"
|
|
172
173
|
),
|
|
173
174
|
style: { height: compact ? GRAPH_NODE_COLLAPSED_HEIGHT : GRAPH_NODE_HEIGHT, width: GRAPH_NODE_WIDTH },
|
|
174
175
|
children: [
|
|
@@ -186,34 +187,32 @@ function GraphNode(_a) {
|
|
|
186
187
|
),
|
|
187
188
|
/* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-1 cursor-pointer flex-col", onClick: handleClick, children: [
|
|
188
189
|
/* @__PURE__ */ jsxs2("div", { className: cn("flex w-full justify-between gap-1 px-2.5", compact && "flex-row-reverse items-start"), children: [
|
|
189
|
-
!!compact && /* @__PURE__ */
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}) }),
|
|
205
|
-
state === "progressing" && /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 flex-row items-center gap-1.5 overflow-hidden", children: /* @__PURE__ */ jsx2("div", { className: "flex size-[20px]! items-center justify-center", children: /* @__PURE__ */ jsx2(Spinner, { size: "sm" }) }) })
|
|
206
|
-
] }),
|
|
190
|
+
!!compact && /* @__PURE__ */ jsx2(Fragment, { children: compactBadges.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 flex-row items-center gap-1.5 overflow-hidden", children: compactBadges.map((_c, index) => {
|
|
191
|
+
var _d = _c, { tooltipContent, variant } = _d, badge = __objRest(_d, ["tooltipContent", "variant"]);
|
|
192
|
+
return /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
193
|
+
/* @__PURE__ */ jsx2(TooltipTrigger, { children: /* @__PURE__ */ jsx2(
|
|
194
|
+
Badge,
|
|
195
|
+
__spreadProps(__spreadValues({
|
|
196
|
+
variant
|
|
197
|
+
}, badge), {
|
|
198
|
+
className: "flex size-[20px]! cursor-default! items-center justify-center p-0!",
|
|
199
|
+
children: badge.children
|
|
200
|
+
})
|
|
201
|
+
) }),
|
|
202
|
+
tooltipContent && /* @__PURE__ */ jsx2(TooltipContent, { children: tooltipContent })
|
|
203
|
+
] }, index);
|
|
204
|
+
}) }) }),
|
|
207
205
|
/* @__PURE__ */ jsxs2("div", { className: "mr-auto grow-0 overflow-hidden", children: [
|
|
208
|
-
/* @__PURE__ */ jsx2("h5", { className: "text-body-sm
|
|
209
|
-
/* @__PURE__ */ jsx2("p", { className: "text-body-sm truncate
|
|
210
|
-
!compact && /* @__PURE__ */ jsx2("p", { className: "text-body-sm text-muted-foreground mt-
|
|
206
|
+
/* @__PURE__ */ jsx2("h5", { className: "text-body-sm truncate font-medium", children: data.title }),
|
|
207
|
+
/* @__PURE__ */ jsx2("p", { className: "text-body-sm text-muted-foreground truncate", children: data.subtitle }),
|
|
208
|
+
!compact && /* @__PURE__ */ jsx2("p", { className: "text-body-sm text-muted-foreground mt-0.5 truncate", children: data.name })
|
|
211
209
|
] }),
|
|
212
210
|
/* @__PURE__ */ jsx2(
|
|
213
|
-
|
|
211
|
+
Badge,
|
|
214
212
|
{
|
|
213
|
+
variant: "secondary",
|
|
215
214
|
className: cn(
|
|
216
|
-
"
|
|
215
|
+
"cursor-default!",
|
|
217
216
|
["progressing", "paused"].includes(state) && "opacity-30",
|
|
218
217
|
data.typeDescriptors.className
|
|
219
218
|
),
|
|
@@ -221,16 +220,13 @@ function GraphNode(_a) {
|
|
|
221
220
|
}
|
|
222
221
|
)
|
|
223
222
|
] }),
|
|
224
|
-
!compact && /* @__PURE__ */ jsx2(Fragment, { children:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}) }),
|
|
232
|
-
state === "progressing" && /* @__PURE__ */ jsx2("div", { className: "ml-auto flex size-[20px]! items-center justify-center", children: /* @__PURE__ */ jsx2(Spinner, { size: "sm" }) })
|
|
233
|
-
] }) })
|
|
223
|
+
!compact && /* @__PURE__ */ jsx2(Fragment, { children: defaultBadges.length > 0 && /* @__PURE__ */ jsx2("div", { className: "mt-auto flex h-8 items-center border-t px-2.5", children: /* @__PURE__ */ jsx2("div", { className: "flex gap-1.5 overflow-hidden overflow-x-auto", children: defaultBadges.map((_e, index) => {
|
|
224
|
+
var _f = _e, { tooltipContent, variant } = _f, badge = __objRest(_f, ["tooltipContent", "variant"]);
|
|
225
|
+
return /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
226
|
+
/* @__PURE__ */ jsx2(TooltipTrigger, { children: /* @__PURE__ */ jsx2(Badge, __spreadProps(__spreadValues({ variant }, badge), { className: "cursor-default! py-px! whitespace-nowrap", children: badge.children })) }),
|
|
227
|
+
tooltipContent && /* @__PURE__ */ jsx2(TooltipContent, { children: tooltipContent })
|
|
228
|
+
] }, index);
|
|
229
|
+
}) }) }) })
|
|
234
230
|
] }),
|
|
235
231
|
!!hasOutgoingEdge && /* @__PURE__ */ jsxs2(
|
|
236
232
|
"div",
|
|
@@ -257,11 +253,13 @@ function GraphNode(_a) {
|
|
|
257
253
|
) }),
|
|
258
254
|
/* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
259
255
|
/* @__PURE__ */ jsx2(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx2(
|
|
260
|
-
|
|
256
|
+
Button,
|
|
261
257
|
{
|
|
262
258
|
type: "button",
|
|
259
|
+
variant: "outline",
|
|
260
|
+
size: "icon-xs",
|
|
263
261
|
"aria-label": data.expanded ? "Collapse" : "Expand",
|
|
264
|
-
className: "
|
|
262
|
+
className: "absolute top-1/2 left-1/2 size-5 -translate-1/2 rounded-full active:not-aria-[haspopup]:-translate-1/2",
|
|
265
263
|
onClick: (e) => {
|
|
266
264
|
var _a3;
|
|
267
265
|
e.stopPropagation();
|
|
@@ -297,7 +295,7 @@ function GraphNodeSkeleton(_props) {
|
|
|
297
295
|
Card,
|
|
298
296
|
{
|
|
299
297
|
className: cn(
|
|
300
|
-
`flex h-[106px]! w-[260px]! flex-col gap-1.5 rounded-
|
|
298
|
+
`flex h-[106px]! w-[260px]! flex-col gap-1.5 rounded-xl px-0 py-0 pt-2.5! pb-0! hover:shadow-md motion-safe:transition-shadow`,
|
|
301
299
|
compact && `h-[47px]!`
|
|
302
300
|
),
|
|
303
301
|
children: [
|
|
@@ -630,7 +628,7 @@ function DataTableSearch({
|
|
|
630
628
|
|
|
631
629
|
// src/data-table/empty-view.tsx
|
|
632
630
|
import { Alert, AlertDescription } from "@upbound/monarch-core";
|
|
633
|
-
import { Button } from "@upbound/monarch-core";
|
|
631
|
+
import { Button as Button2 } from "@upbound/monarch-core";
|
|
634
632
|
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@upbound/monarch-core";
|
|
635
633
|
import { Icon as Icon3 } from "@upbound/monarch-core";
|
|
636
634
|
import { IconTile } from "@upbound/monarch-core";
|
|
@@ -665,7 +663,7 @@ function DataTableEmptyView({
|
|
|
665
663
|
const isFilteredEmpty = tableState === "empty" && filterCount > 0;
|
|
666
664
|
const config = tableState === "error" ? mergeConfig(defaultErrorConfig, emptyView == null ? void 0 : emptyView.error) : tableState === "empty" ? isFilteredEmpty ? mergeConfig(defaultNoFilterFoundConfig, emptyView == null ? void 0 : emptyView.filter) : mergeConfig(defaultEmptyConfig, emptyView == null ? void 0 : emptyView.empty) : null;
|
|
667
665
|
const wrapperClassName = tableState === "error" ? (_c = (_a = emptyView == null ? void 0 : emptyView.error) == null ? void 0 : _a.wrapperClassName) != null ? _c : (_b = emptyView == null ? void 0 : emptyView.empty) == null ? void 0 : _b.wrapperClassName : config == null ? void 0 : config.wrapperClassName;
|
|
668
|
-
const defaultAction = isFilteredEmpty && !(config == null ? void 0 : config.action) ? /* @__PURE__ */ jsxs4(
|
|
666
|
+
const defaultAction = isFilteredEmpty && !(config == null ? void 0 : config.action) ? /* @__PURE__ */ jsxs4(Button2, { variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
669
667
|
/* @__PURE__ */ jsx5(Icon3, { name: "xmark" }),
|
|
670
668
|
"Clear filters"
|
|
671
669
|
] }) : null;
|
|
@@ -689,7 +687,7 @@ import * as React5 from "react";
|
|
|
689
687
|
import * as React4 from "react";
|
|
690
688
|
import { Icon as Icon4 } from "@upbound/monarch-core";
|
|
691
689
|
import { Badge as Badge2 } from "@upbound/monarch-core";
|
|
692
|
-
import { Button as
|
|
690
|
+
import { Button as Button3 } from "@upbound/monarch-core";
|
|
693
691
|
import { ButtonGroup, ButtonGroupText } from "@upbound/monarch-core";
|
|
694
692
|
import { Calendar } from "@upbound/monarch-core";
|
|
695
693
|
import {
|
|
@@ -812,7 +810,7 @@ function FilterBar(_a) {
|
|
|
812
810
|
if (filter) handleAddFilter(filter.key);
|
|
813
811
|
},
|
|
814
812
|
children: [
|
|
815
|
-
/* @__PURE__ */ jsxs5(ComboboxTrigger, { "aria-label": "Add filter", showIndicator: false, render: /* @__PURE__ */ jsx6(
|
|
813
|
+
/* @__PURE__ */ jsxs5(ComboboxTrigger, { "aria-label": "Add filter", showIndicator: false, render: /* @__PURE__ */ jsx6(Button3, { variant: "outline" }), children: [
|
|
816
814
|
/* @__PURE__ */ jsx6(Icon4, { name: "plus", "data-icon": "inline-start" }),
|
|
817
815
|
"Add filter"
|
|
818
816
|
] }),
|
|
@@ -909,7 +907,7 @@ function FilterChip({ definition, value, autoOpen, container, onChangeValue, onR
|
|
|
909
907
|
}
|
|
910
908
|
}
|
|
911
909
|
function FilterChipRemoveButton({ label, onRemove }) {
|
|
912
|
-
return /* @__PURE__ */ jsx6(
|
|
910
|
+
return /* @__PURE__ */ jsx6(Button3, { variant: "outline", size: "icon", "aria-label": `Remove ${label} filter`, onClick: onRemove, children: /* @__PURE__ */ jsx6(Icon4, { name: "xmark" }) });
|
|
913
911
|
}
|
|
914
912
|
function CheckboxFilterChip({
|
|
915
913
|
definition,
|
|
@@ -943,7 +941,7 @@ function CheckboxFilterChip({
|
|
|
943
941
|
/* @__PURE__ */ jsx6(
|
|
944
942
|
ComboboxTrigger,
|
|
945
943
|
{
|
|
946
|
-
render: /* @__PURE__ */ jsx6(
|
|
944
|
+
render: /* @__PURE__ */ jsx6(Button3, { variant: "outline", className: "gap-1 font-normal [&>svg:last-child]:size-(--icon-sm)" }),
|
|
947
945
|
children: /* @__PURE__ */ jsx6("span", { className: values.length === 0 ? "text-muted-foreground" : "", children: displayLabel })
|
|
948
946
|
}
|
|
949
947
|
),
|
|
@@ -977,7 +975,7 @@ function CheckboxFilterChip({
|
|
|
977
975
|
]
|
|
978
976
|
}
|
|
979
977
|
) : /* @__PURE__ */ jsxs5(DropdownMenu, { defaultOpen: autoOpen, children: [
|
|
980
|
-
/* @__PURE__ */ jsx6(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs5(
|
|
978
|
+
/* @__PURE__ */ jsx6(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs5(Button3, { variant: "outline", className: "gap-1 font-normal", children: [
|
|
981
979
|
/* @__PURE__ */ jsx6("span", { className: values.length === 0 ? "text-muted-foreground" : "", children: displayLabel }),
|
|
982
980
|
/* @__PURE__ */ jsx6(Icon4, { name: "chevron-down", size: "sm", className: "text-muted-foreground" })
|
|
983
981
|
] }) }),
|
|
@@ -1028,7 +1026,7 @@ function RadioFilterChip({
|
|
|
1028
1026
|
/* @__PURE__ */ jsx6(
|
|
1029
1027
|
ComboboxTrigger,
|
|
1030
1028
|
{
|
|
1031
|
-
render: /* @__PURE__ */ jsx6(
|
|
1029
|
+
render: /* @__PURE__ */ jsx6(Button3, { variant: "outline", className: "gap-1 font-normal [&>svg:last-child]:size-(--icon-sm)" }),
|
|
1032
1030
|
children: /* @__PURE__ */ jsx6("span", { className: selectedValue ? "" : "text-muted-foreground", children: displayLabel })
|
|
1033
1031
|
}
|
|
1034
1032
|
),
|
|
@@ -1055,7 +1053,7 @@ function RadioFilterChip({
|
|
|
1055
1053
|
]
|
|
1056
1054
|
}
|
|
1057
1055
|
) : /* @__PURE__ */ jsxs5(DropdownMenu, { defaultOpen: autoOpen, children: [
|
|
1058
|
-
/* @__PURE__ */ jsx6(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs5(
|
|
1056
|
+
/* @__PURE__ */ jsx6(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs5(Button3, { variant: "outline", className: "gap-1 font-normal", children: [
|
|
1059
1057
|
/* @__PURE__ */ jsx6("span", { className: selectedValue ? "" : "text-muted-foreground", children: displayLabel }),
|
|
1060
1058
|
/* @__PURE__ */ jsx6(Icon4, { name: "chevron-down", size: "sm", className: "text-muted-foreground" })
|
|
1061
1059
|
] }) }),
|
|
@@ -1080,7 +1078,7 @@ function TextFilterChip({
|
|
|
1080
1078
|
return /* @__PURE__ */ jsxs5(ButtonGroup, { children: [
|
|
1081
1079
|
/* @__PURE__ */ jsx6(ButtonGroupText, { children: label }),
|
|
1082
1080
|
/* @__PURE__ */ jsxs5(Popover, { open, onOpenChange: setOpen, children: [
|
|
1083
|
-
/* @__PURE__ */ jsx6(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(
|
|
1081
|
+
/* @__PURE__ */ jsx6(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(Button3, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx6("span", { className: text ? "" : "text-muted-foreground", children: text || "Any" }) }) }),
|
|
1084
1082
|
/* @__PURE__ */ jsx6(PopoverContent, { align: "start", children: /* @__PURE__ */ jsx6(
|
|
1085
1083
|
Input,
|
|
1086
1084
|
{
|
|
@@ -1123,7 +1121,7 @@ function MultiTextFilterChip({
|
|
|
1123
1121
|
return /* @__PURE__ */ jsxs5(ButtonGroup, { children: [
|
|
1124
1122
|
/* @__PURE__ */ jsx6(ButtonGroupText, { children: label }),
|
|
1125
1123
|
/* @__PURE__ */ jsxs5(Popover, { defaultOpen: autoOpen, children: [
|
|
1126
|
-
/* @__PURE__ */ jsx6(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(
|
|
1124
|
+
/* @__PURE__ */ jsx6(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(Button3, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx6("span", { className: tokens.length === 0 ? "text-muted-foreground" : "", children: displayLabel }) }) }),
|
|
1127
1125
|
/* @__PURE__ */ jsx6(PopoverContent, { align: "start", children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
|
|
1128
1126
|
tokens.length > 0 && /* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-1", children: tokens.map((token) => /* @__PURE__ */ jsxs5(Badge2, { variant: "secondary", className: "gap-1", children: [
|
|
1129
1127
|
token,
|
|
@@ -1190,7 +1188,7 @@ function DateFilterChip({
|
|
|
1190
1188
|
return /* @__PURE__ */ jsxs5(ButtonGroup, { children: [
|
|
1191
1189
|
/* @__PURE__ */ jsx6(ButtonGroupText, { children: label }),
|
|
1192
1190
|
/* @__PURE__ */ jsxs5(Popover, { defaultOpen: autoOpen, children: [
|
|
1193
|
-
/* @__PURE__ */ jsx6(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(
|
|
1191
|
+
/* @__PURE__ */ jsx6(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx6(Button3, { variant: "outline", className: "gap-1 font-normal", children: /* @__PURE__ */ jsx6("span", { className: startDate ? "" : "text-muted-foreground", children: displayLabel }) }) }),
|
|
1194
1192
|
/* @__PURE__ */ jsx6(PopoverContent, { align: "start", className: "w-fit", children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
|
|
1195
1193
|
/* @__PURE__ */ jsx6(
|
|
1196
1194
|
Calendar,
|
|
@@ -1590,7 +1588,15 @@ function useViewportFocus(nodeMap, viewportFocusNodeId) {
|
|
|
1590
1588
|
|
|
1591
1589
|
// src/graph/graph-view.tsx
|
|
1592
1590
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1593
|
-
var GraphViewInternal = ({
|
|
1591
|
+
var GraphViewInternal = ({
|
|
1592
|
+
nodeTypes: parentNodeTypes,
|
|
1593
|
+
edgeTypes: parentEdgeTypes,
|
|
1594
|
+
children,
|
|
1595
|
+
viewportFocusNodeId,
|
|
1596
|
+
className,
|
|
1597
|
+
hideMiniMap = false,
|
|
1598
|
+
hideControls = false
|
|
1599
|
+
}) => {
|
|
1594
1600
|
const { nodes, edges, toggleNodeExpansion } = useGraphActionsContext();
|
|
1595
1601
|
const nodeTypes = React7.useMemo(
|
|
1596
1602
|
() => __spreadValues({
|
|
@@ -1629,6 +1635,7 @@ var GraphViewInternal = ({ nodeTypes: parentNodeTypes, edgeTypes: parentEdgeType
|
|
|
1629
1635
|
return /* @__PURE__ */ jsxs6(
|
|
1630
1636
|
ReactFlow,
|
|
1631
1637
|
{
|
|
1638
|
+
className: cn("overflow-hidden rounded-xl border", className),
|
|
1632
1639
|
nodeTypes,
|
|
1633
1640
|
edgeTypes,
|
|
1634
1641
|
nodes: layoutedNodes,
|
|
@@ -1645,17 +1652,40 @@ var GraphViewInternal = ({ nodeTypes: parentNodeTypes, edgeTypes: parentEdgeType
|
|
|
1645
1652
|
panOnScroll: true,
|
|
1646
1653
|
selectionOnDrag: true,
|
|
1647
1654
|
children: [
|
|
1648
|
-
/* @__PURE__ */ jsx9(Background, { className: "bg-muted
|
|
1649
|
-
/* @__PURE__ */ jsx9(Controls, { showInteractive: false }),
|
|
1650
|
-
/* @__PURE__ */ jsx9(MiniMap, { zoomable: true, pannable: true }),
|
|
1655
|
+
/* @__PURE__ */ jsx9(Background, { className: "bg-muted/50", size: 2 }),
|
|
1656
|
+
!hideControls && /* @__PURE__ */ jsx9(Controls, { showInteractive: false }),
|
|
1657
|
+
!hideMiniMap && /* @__PURE__ */ jsx9(MiniMap, { zoomable: true, pannable: true }),
|
|
1651
1658
|
children
|
|
1652
1659
|
]
|
|
1653
1660
|
}
|
|
1654
1661
|
);
|
|
1655
1662
|
};
|
|
1656
|
-
var GraphView = React7.forwardRef(
|
|
1657
|
-
|
|
1658
|
-
|
|
1663
|
+
var GraphView = React7.forwardRef(
|
|
1664
|
+
({
|
|
1665
|
+
defaultNodes = [],
|
|
1666
|
+
defaultEdges = [],
|
|
1667
|
+
nodeTypes,
|
|
1668
|
+
edgeTypes,
|
|
1669
|
+
children,
|
|
1670
|
+
viewportFocusNodeId,
|
|
1671
|
+
className,
|
|
1672
|
+
hideMiniMap,
|
|
1673
|
+
hideControls
|
|
1674
|
+
}, ref) => {
|
|
1675
|
+
return /* @__PURE__ */ jsx9(ReactFlowProvider, { children: /* @__PURE__ */ jsx9(GraphActionsProvider, { ref, initialNodes: defaultNodes, initialEdges: defaultEdges, children: /* @__PURE__ */ jsx9(
|
|
1676
|
+
GraphViewInternal,
|
|
1677
|
+
{
|
|
1678
|
+
nodeTypes,
|
|
1679
|
+
edgeTypes,
|
|
1680
|
+
viewportFocusNodeId,
|
|
1681
|
+
className,
|
|
1682
|
+
hideMiniMap,
|
|
1683
|
+
hideControls,
|
|
1684
|
+
children
|
|
1685
|
+
}
|
|
1686
|
+
) }) });
|
|
1687
|
+
}
|
|
1688
|
+
);
|
|
1659
1689
|
GraphView.displayName = "GraphView";
|
|
1660
1690
|
|
|
1661
1691
|
// src/graph/graph.tsx
|
|
@@ -1684,6 +1714,9 @@ function Graph({
|
|
|
1684
1714
|
emptyView,
|
|
1685
1715
|
showError,
|
|
1686
1716
|
className,
|
|
1717
|
+
canvasClassName,
|
|
1718
|
+
hideMiniMap = false,
|
|
1719
|
+
hideControls = false,
|
|
1687
1720
|
loading = false,
|
|
1688
1721
|
ActionsComponent: Actions,
|
|
1689
1722
|
disableSearch = false,
|
|
@@ -1778,6 +1811,9 @@ function Graph({
|
|
|
1778
1811
|
ref: graphRef,
|
|
1779
1812
|
nodeTypes: memoizedNodeTypes,
|
|
1780
1813
|
edgeTypes: memoizedEdgeTypes,
|
|
1814
|
+
className: canvasClassName,
|
|
1815
|
+
hideMiniMap,
|
|
1816
|
+
hideControls,
|
|
1781
1817
|
children
|
|
1782
1818
|
}
|
|
1783
1819
|
)
|